高手帮我看下ASP问题我不懂了

来源:百度知道 编辑:UC知道 时间:2024/06/01 05:45:26
<!--#include file = "conn.asp"-->
<!--#include file = "md5.asp"-->
<%
LOGINID = trim(request("LOGINID"))
password = trim(request("password"))
confirm_password = trim(request("confirm_password"))

if (password <> confirm_password) then
response.write "两次输入的密码不一致!"
response.end
end if

password=md5(password)
password=mid(password,"9","16")

set rs=server.CreateObject("adodb.recordset")
strsql="select * from USER where username='"&trim(LOGINID)&"'"
rs.open strsql,conn,3,3
if not rs.eof then
response.write"注册失败!"
response.write"您输入的用户名已经存在,请重新输入!<a href=javascript:history.go(-1)><font color=red>按此返回</font>"
rs.close
else
rs.addnew
rs("username")=LOGINID
rs("password&quo

)><font color=red>按此返回</font>"
rs.close

把他改成
)><font color=red>按此返回</font>"

rs.close 不要

重新下吧,没人可以看懂那个

strsql="select * from [USER] where username='"&trim(LOGINID)&"'"
你试下这个,还有把rs.close全部去掉试一下!

response.write"注册失败!"
response.write"您输入的用户名已经存在,请重新输入!<a href=javascript:history.go(-1)><font color=red>按此返回</font>"
rs.close
把上面的rs.close去掉
因为你在end IF后有rs.close