📄 userreg.asp
字号:
<!--#include file="head.asp"-->
<!--#include file="md5.asp"-->
<%
if Request("RegSetp") = 2 then
if Trim(Request.Form("username")) = "" then
Errmsg = "<li>请输入用户名。"
FoundErr = true
else
username = Qcdn.checkStr(Trim(Request.Form("username")))
end if
if Trim(Request.Form("password")) = "" then
Errmsg = Errmsg + "<li>请输入密码。"
FoundErr = true
else
password = Qcdn.checkStr(Trim(Request.Form("password")))
end if
if Trim(Request.Form("password2")) = "" then
Errmsg = Errmsg + "<li>请输入确认密码。"
FoundErr = true
else
password2 = Trim(Request.Form("password2"))
end if
if password <> password2 then
Errmsg = Errmsg + "<li>输入的密码及确认密码不符。"
FoundErr = true
else
password = md5(password,16)
end if
if Trim(Request.Form("email")) = "" then
Errmsg = Errmsg + "<li>请输入EMAIL。"
FoundErr = true
elseif Qcdn.IsValidEmail(Trim(Request.Form("email"))) = false then
Errmsg = Errmsg + "<li>请输入正确的EMAIL。"
FoundErr = true
else
e_mail = Trim(Request.Form("email"))
end if
if Trim(Request.Form("question")) = "" then
Errmsg = Errmsg + "<li>请输入密码提示问题。"
FoundErr = true
else
question = Qcdn.checkStr(Trim(Request.Form("question")))
end if
if Trim(Request.Form("answer")) = "" then
Errmsg = Errmsg + "<li>请输入密码提示答案。"
FoundErr = true
else
answer = Qcdn.checkStr(Trim(Request.Form("answer")))
end if
if Trim(Request.Form("qq")) = "" then
qq = 0
else
if Qcdn.isInteger(Trim(Request.Form("qq"))) = false then
Errmsg = Errmsg + "<li>请输入正确的QQ号码"
FoundErr = true
else
qq = Trim(Request.Form("qq"))
end if
end if
if Trim(Request.Form("msn")) <> "" then
if Qcdn.IsValidEmail(Trim(Request.Form("msn"))) = false then
Errmsg = Errmsg + "<li>请输入正确的MSN号码"
FoundErr = true
else
msn = Trim(Request.Form("msn"))
end if
end if
if Trim(Request.Form("birthYear")) = "" then
Errmsg = Errmsg + "<li>请输入年份。"
FoundErr = true
elseif Qcdn.isInteger(Trim(Request.Form("birthYear"))) = false then
Errmsg = Errmsg + "<li>请输入正确的年份"
FoundErr = true
else
birth = Trim(Request.Form("birthYear")) &"-"& Request.form("birthMonth") &"-"& Request.form("birthDay")
end if
if Trim(Request.Form("postcode")) <> "" then
if Qcdn.isInteger(Trim(Request.Form("postcode"))) = false then
Errmsg = Errmsg + "<li>请输入正确的邮编。"
FoundErr = true
else
postcode = Trim(Request.Form("postcode"))
end if
elseif Trim(Request.Form("postcode")) = "" then
postcode = 0
end if
if FoundErr then
Call Qcdn.Err_List(Errmsg,2)
Response.End()
end if
male = Request.form("male")
bloodtype = Request.form("bloodtype")
realname = Qcdn.checkstr(Trim(Request.form("realname")))
country = Qcdn.checkstr(Trim(Request.form("country")))
province = Qcdn.checkstr(Trim(Request.form("province")))
city = Qcdn.checkstr(Trim(Request.form("city")))
phone = Qcdn.checkstr(Trim(Request.form("phone")))
address = Qcdn.checkstr(Trim(Request.form("address")))
job = Request.form("job")
edu = Request.form("edu")
school = Qcdn.checkstr(Trim(Request.form("school")))
SqlStr = "Select Unid from article_User where username = '"& username &"' or email = '"& e_mail &"'"
set Rs = conn.execute(SqlStr)
if rs.eof and rs.bof then
Sql = "Insert into article_User(username,[password],email,question,answer,qq,msn,male,birth,bloodtype,realname,country,province,city,phone,[address],postcode,job,edu,school,Intime)values('"& username &"','"& password &"','"& e_mail &"','"& question &"','"& answer &"','"& qq &"','"& msn &"',"& male &",'"& birth &"','"& bloodtype &"','"& realname &"','"& country &"','"& province &"','"& city &"','"& phone &"','"& address &"',"& postcode &",'"& job &"','"& edu &"','"& school &"',Now())"
conn.execute(sql)
Response.write ("<script>alert(""注册成功"");location.href=""index.asp"";</script>")
Response.end
else
Response.write ("<script>alert(""此用户名或电子邮件已有人使用"");location.href=""UserReg.asp"";</script>")
Response.end
end if
response.end
elseif Request("RegSetp") = 1 then
%>
<form name="myForm" method="post" action="UserReg.asp" id="myForm">
<table class="twidth" align=center cellspacing=0 cellpadding=0>
<tr>
<td class="mframe-t-left"></td>
<td class="mframe-t-mid">
<span class="mframe-t-text">会员注册</span>
</td>
<td class="mframe-t-right"></td>
</tr>
</table>
<table class="twidth" align=center cellspacing=0 cellpadding=0>
<tr>
<td class="mframe-m-left"></td>
<td class="mframe-m-mid" style="padding:10px; line-height:130%">
<span id="myLabel" style="width:100%;text-align:center"></span>
<table width=95% align=center>
<tr>
<td width=250> <b>用户名:</b> </td>
<td> <input name="Username" type="text" maxlength="50" id="Username" Size="20" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>密 码:</b> </td>
<td> <input name="password" type="password" maxlength="50" id="password" Size="20" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>密 码(确认):</b> </td>
<td> <input name="password2" type="password" maxlength="50" id="password2" Size="20" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>e-mail:</b> </td>
<td> <input name="email" type="text" maxlength="80" id="email" Size="20" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>找回密码问题:</b> </td>
<td> <input name="question" type="text" maxlength="100" id="question" Size="50" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>找回密码答案:</b> </td>
<td> <input name="answer" type="text" maxlength="100" id="answer" Size="50" />
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width=250> <b>QQ:</b> </td>
<td> <input name="qq" type="text" maxlength="20" id="qq" Size="20" />
</td>
</tr>
<tr>
<td width=250> <b>MSN:</b> </td>
<td> <input name="msn" type="text" maxlength="100" id="msn" Size="20" />
</td>
</tr>
<tr>
<td colspan=2 class="summary-title"> 个人资料 </td>
</tr>
<tr>
<td width=250> <b>性别:</b> </td>
<td> <table id="male" border="0">
<tr>
<td><input id="male" type="radio" name="male" value="1" checked="checked" />
男</td>
<td><input id="male" type="radio" name="male" value="0" />
女</td>
</tr>
</table></td>
</tr>
<tr>
<td width=250> <b>生日:</b> </td>
<td> <input name="birthYear" type="text" maxlength="4" id="birthYear" Size="4" />
年<font color="#FF0000">*</font>
<select name="birthMonth" id="birthMonth">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -