📄 reg.asp
字号:
<!--
版本:草原二手市场V1.1
本程序作者:mysql QQ:54016224 TEL:13036133798
-->
<!--#include file = "include/conn.asp"-->
<!--#include file = "include/function.asp"-->
<!--#include file = "include/md5.asp"-->
<%
username = toValidChar(request("username"))
userpass = toValidChar(request("userpass"))
confirmuserpass = toValidChar(request("confirmuserpass"))
email = toValidChar(request("Email"))
'**************check null**************'
if trim(username) = "" or trim(userpass) = "" or trim(confirmuserpass) = "" or trim(email) = "" then
response.write "<script>alert('您必须把资料添加完整');history.go(-1);</script>"
response.End()
end if
'**************check null end *********'
'**************check user exist********'
sql = "select * from [User] where UserName = '"&username&"'"
set rs = conn.execute(sql)
if not rs.eof and not rs.bof then
response.write "<script>alert('该用户已经存在,请重新注册');history.go(-1);</script>"
response.End()
end if
'**************check user exist end****'
'**************check password *********'
if userpass <> confirmuserpass then
response.write "<script>alert('您两次密码输入不一致');history.go(-1);</script>"
response.End()
end if
'**************check password end *****'
'**************check email legal ******'
if checkEmail(email) = false then
response.write "<script>alert('您输入的email不合法');history.go(-1);</script>"
response.End()
end if
'**************check email legal end********'
'**************check email exist********'
sql = "select * from [User] where UserEmail = '"&email&"'"
set rs = conn.execute(sql)
if not rs.eof and not rs.bof then
response.write "<script>alert('该email已经存在,请重新注册');history.go(-1);</script>"
response.End()
end if
'**************check email exist end****'
'**************reg user start****'
userpass = md5(userpass)
sql = "insert into [User](UserName,UserPwd,UserEmail) values('"&username&"','"&userpass&"','"&email&"')"
conn.execute(sql)
response.write "<script>alert('注册成功!');window.location.href='login.asp';</script>"
response.end
'**************reg user end****'
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -