请大神帮助下小弟!谢谢
麻烦大神看下 这里那里出错了 !每次注册都是显示“对不起,此用户名已经有人使用!请换一个吧”都是说被使用过的 !不知道是哪里出错了 大神帮忙下!谢谢!!
<%@ LANGUAGE = VBScript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户注册</title>
</head>
<!--#include file="../conn.asp"-->
<!--#include file="md5.asp"-->
<body>
<%
username = formdata(request.form("username"))
if username="" then
%>
<script language='javascript'> alert ('用户名不能为空!');history.go(-1)</script>
<%
else
sSql="select id from users where username='"& username &"'"
set rs = conn.execute(sSql)
if not rs.eof then
%>
<script language='javascript'> alert ('对不起,此用户名已经有人使用!请换一个吧!');history.go(-1)</script>
<%
response.End()
else
userpass = md5(trim(formdata(request.form("userpwd"))),16)
uname = formdata(request.form("truename"))
qq = formdata(request.form("oicq"))
province = formdata(request.form("shf"))
city = formdata(request.form("chs"))
bank_bank = formdata(request.form("carofbank"))
bank_name = formdata(request.form("bankname"))
bank_num = formdata(request.form("carnumber"))
regfrom = formdata(request.form("regfrom"))
if regfrom="" then
regfrom="&admin&"
else
SQL = "Select regfrom From users where username='"®from&"'"
set rr=conn.execute(sql)
regf=rr("regfrom")
regfrom="&"®from&"&"®f
end if
'response.write regfrom
SQL = "Select * From users"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open SQL,conn,1,2
Rs.addnew
Rs("username") = username
Rs("userpass") = userpass
Rs("qq") = qq
Rs("bank_bank") = bank_bank
Rs("bank_area")= province&city
Rs("bank_name") = bank_name
Rs("bank_num") = bank_num
Rs("regfrom") = regfrom
Rs("state") = 0
Rs("bonus11")=1700
Rs("bonus12")=570
Rs("bonus13")=280
Rs("bonus14")=6.6
Rs("bonus15")=17
Rs("bonus16")=170
Rs("bonus17")=17
Rs("bonus18")=170
Rs("bonus19")=6.8
Rs("bonus21")=1700
Rs("bonus22")=570
Rs("bonus23")=280
Rs("bonus24")=6.6
Rs("bonus25")=17
Rs("bonus26")=170
Rs("bonus27")=17
Rs("bonus28")=170
Rs("bonus31")=1700
Rs("bonus32")=570
Rs("bonus33")=280
Rs("bonus34")=6.6
Rs("bonus35")=17
Rs("bonus36")=170
Rs("bonus37")=17
Rs("bonus38")=170
Rs("bonus41")=1700
Rs("bonus42")=570
Rs("bonus43")=280
Rs("bonus44")=6.6
Rs("bonus45")=17
Rs("bonus46")=170
Rs("bonus47")=17
Rs("bonus48")=170
Rs("bonus51")=1700
Rs("bonus52")=570
Rs("bonus53")=280
Rs("bonus54")=6.6
Rs("bonus55")=17
Rs("bonus56")=170
Rs("bonus57")=17
Rs("bonus58")=170
Rs("bonus59")=6.8
Rs.update
closedb()
'response.write regfrom
%>
<script language='javascript'> alert ('注册成功');location.href='../index.asp'</script>
<%
end if
end if
%>
</body>
</html>