我做的那是简单用户注册程序,当我填写完所有注册信息点注册后它提示说注册成功
但是再用回我刚才注册的信息去登陆就登陆不到
因为它并没有把我的注册信息写入数据库里面
可是又没有提示什么错误
好晕哦!!我都不知道错在哪里 保存注册信息的页面代码如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../public/conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册成功画面</title>
</head>
<body>
<!--#include file="../public/top.asp"-->
<table width="700" height="43" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center" valign="middle">
<%
Set rs=Server.CreateObject("adodb.RecordSet")
sql="select * from user where username='"&trim(request("username"))&"'"
rs.Open sql,secondconn,3,3
If NOT rs.eof Then
errmsg=errmsg+"<br><li>用户名 "+trim(request("username"))+" 已被别人注册啦"
founderr=true
End If
rs.Close
Set rs=Nothing
set rs1=server.createobject("adodb.Recordset")
sql1="select * from user where nickname='"&trim(request("nickname"))&"'"
rs1.open sql1,secondconn,3,3
if not rs1.eof then
errmsg=errmsg+"<br><li>昵称 "+trim(request("nickname"))+" 已被别人注册啦"
founderr=true
end if
rs1.close
set rs1=nothing
set rs2=Server.CreateObject("adodb.RecordSet")
sql2="select * from user where truename='"&trim(request("truename"))&"'"
rs2.Open sql2,secondconn,3,3
if not rs2.eof then
errmsg=errmsg+"<br><li>真实姓名 "+trim(request("truename"))+" 已被别人注册啦"
founderr=true
end if
rs2.close
set rs2=nothing
if trim(request("birthyear"))="" then
birthyear=" "
else
birthyear=trim(request("birthyear"))
end if
if trim(request("birthmonth"))="" then
birthmonth=" "
else
birthmonth=trim(request("birthmonth"))
end if
if trim(request("birthday"))="" then
birthday=" "
else
birthday=trim(request("birthday"))
end if
if trim(request("mobile"))="" then
mobile=" "
else
mobile=trim(request("mobile"))
end if
if trim(request("homeaddress"))="" then
homeaddress="没有填写"
else
homeaddress=trim(request("homeaddress"))
end if
if trim(request("homepostcode"))="" then
homepostcode=" "
else
homepostcode=trim(request("homepostcode"))
end if
if trim(request("hometel"))="" then
hometel=" "
else
hometel=trim(request("hometel"))
end if
if trim(request("companyaddress"))="" then
companyaddress=" "
else
companyaddress=trim(request("companyaddress"))
end if
if trim(request("companypostcode"))="" then
companypostcode=" "
else
companypostcode=trim(request("companypostcode"))
end if
if trim(request("companytel"))="" then
companytel=" "
else
companytel=trim(request("companytel"))
end if
if trim(request("qq"))="" then
qq=" "
else
qq=trim(request("qq"))
end if
if trim(request("homepage"))="" then
homepage=" "
else
homepage=trim(request("homepage"))
end if
if trim(request("selfintro"))="" then
selfintro="这位同学好懒,没有留下任何案底"
else
selfintro=trim(request("selfintro"))
end if
if trim(request("memo"))="" then
memo=" "
else
memo=trim(request("memo"))
end if
if founderr=true then
response.write errmsg
else
set rs1=server.createobject("adodb.recordset")
sql1="select * from user where (userid is null)"
rs1.open sql1,secondconn,3,3
rs1.addnew
rs1("username")=trim(request("username"))
rs1("password")=trim(request("password"))
rs1("nickname")=trim(request("nickname"))
rs1("truename")=trim(request("truename"))
rs1("email")=trim(request("email"))
rs1("birthyear")=birthyear
rs1("birthmonth")=birthmonth
rs1("birthday")=birthday
rs1("mobile")=mobile
rs1("homepostcode")=homepostcode
rs1("hometel")=hometel
rs1("companyaddress")=companyaddress
rs1("homeaddress")=homeaddress
rs1("companypostcode")=companypostcode
rs1("companytel")=companytel
rs1("qq")=qq
rs1("homepage")=homepage
rs1("selfintro")=selfintro
rs1("memo")=memo
rs1("sex")=request("sex")
rs1("regtime")=now()
rs1("updatetime")=now()
rs1("logincount")=0
rs1("quanxian")="guest"
rs1("checked")=false
rs1.update
rs1.close
set rs1=nothing
set rs1=nothing
response.Write "恭喜你已经成为我们06计机的同学啦!"
end if
%>
</td>
</tr>
</table>
<!--#include file="../public/bottom.asp"-->
</body>
</html>