按照教材上编了两个网页,一个是会员注册的网页,很普通的那种html的,没有问题。第二个就是会员注册完了之后处理他的asp网页,也很简单,就是实现两个功能:1、检查已经创建好的表中(表名是user)有无存在的会员代号,有的话,就提示返回重新再注册新代号 2、无存在会员,则提示注册成功,并且显示会员注册资料。 我按按照书上的编的,可是第2个处理的asp网页怎么却老报错呢??真是不解啊。。求高手给看一下哪里错了。
<html> <body> <% id=lcase(trim(request.form("id"))) dim rs set rs=createobject("adodb.recordset") sqlstr="select * from user " sqlstr=sqlstr&"where id='"&id&"'" dsnstr="dsn=yyl;uid=bitsky;pwd=625"
rs.open sqlstr,dsnstr,3,1
if rs.eof=true then user_existed=flase else user_existed=true end if
rs.close set rs=nothing
if user_existed=true then response.write"对不起,代号"&id&"已经有人使用,请重新选择会员代号。"&"<br>" %> <form><input type="button" value="返回重新注册" onclick="goback()"></form> <% else session("id")=lcase(trim(request.form("id"))) session("name")=trim(request.form("name")) session("nickname")=trim(request.form("nickname")) session("sex")=trim(request.form("sex")) session("birth")=trim(request.form("year"))&"/"&trim(request.form("month"))&"/"&trim(request.form("day")) session("email")=trim(request.form("email")) session("address")=trim(request.form("address")) session("telephone")=trim(request.form("telephone")) response.write"您的注册信息如下"&"<br>" response.write"代号:"&session("id")&"<br>" response.write"姓名:"&session("name")&"<br>" response.write"昵称:"&session("nickname")&"<br>" response.write"性别:"&session("sex")&"<br>" response.write"生日:"&session("birth")&"<br>" response.write"电子邮件:"&session("email")&"<br>" response.write"地址:"&session("address")&"<br>" response.write"联系电话:"&session("telephone")&"<br>" %> <form action="addnewuser.asp" method="post"> <input type=submit value="确认提交"> <input type=button value="返回重置" onclick="goback()"></form> <script language=vbscript> sub goback()
window.history.back end sub </script>
</body></html>