📄 reg.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="nimda/config.asp"-->
<!--#include file="edulcni/conn.asp"--> <%
if NOT isempty(request("RegSubmit")) then
if session("regtimes")=1 then
call MsgBox("对不起,您刚注册过用户!","Back","None")
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select UserName,UserEmail from [user] where UserName='"&trim(request("UserName"))&"' or UserEmail='"&trim(request("UserEmail"))&"'",conn,1,1
if not rs.eof and not rs.bof then
call MsgBox("您输入的用户名或Email地址已存在,请返回重新输入!","Back","None")
end if
rs.close
rs.open "select * from [user]",conn,1,3
rs.addnew
rs("UserName")=trim(request("UserName"))
rs("UserPassword")=md5(trim(request("UserPassword")))
rs("UserEmail")=trim(request("UserEmail"))
rs("UserQuestion")=trim(request("UserQuestion"))
rs("UserAnswer")=md5(trim(request("UserAnswer")))
rs("realname")=trim(request("realname"))
'身份证
rs("identify")=trim(request("identify"))
rs("mobile")=trim(request("mobile"))
rs("QQ")=trim(request("QQ"))
rs("JoinDate")=now()
rs("LastLogin")=now()
rs("Userlogins")=0
dim Ip
Ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If Ip= "" Then
Ip=Request.ServerVariables("REMOTE_ADDR")
End if
rs("IP")=IP
rs("postcode")=0
rs("score")=0
rs("paymethod")=0
rs("delivermethod")=0
rs.update
rs.close
set rs=nothing
response.Cookies(cookieName)("UserName")=trim(request("UserName"))
response.Cookies(cookieName).expires=date+1
session("regtimes")=1
session.Timeout=1
call MsgBox("注册成功!请到用户管理中心填详细资料!","GoUrl","muser.asp")
end if%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>E书部落—网上书城</title>
<link href="style.css" rel="stylesheet" type="text/css"></head>
<body>
<!--#include file="head.htm"-->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"> <br> <br> <table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="18"><img src="images/w.gif"></td>
<td style="color:#415373">用户注册</td>
</tr>
</table> <br> <br> <FORM NAME="userinfo" METHOD="post" ACTION="" >
<TABLE BORDER="0" ALIGN="center" CELLPADDING="2" CELLSPACING="1" >
<tr>
<TD colspan="2" ALIGN="center"><FONT COLOR="#cb6f00">请填写用户信息</FONT></TD>
</tr>
<TR>
<TD align="right"><FONT COLOR="#cb6f00">*用户名:</FONT></TD>
<TD><INPUT NAME="UserName" TYPE="text" ID="UserName2" >用户名长度不能小于2。</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">*密码:</FONT></div></TD>
<TD>
<INPUT NAME="UserPassword" TYPE="Password" ID="UserPassword">长度必须大于6个字符。</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">*确认密码:</FONT> </div></TD>
<TD>
<INPUT NAME="UserPassword1" TYPE="Password" ID="UserPassword1">
</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">*E-Mail:</FONT> </div></TD>
<TD>
<INPUT NAME="UserEmail" TYPE="text" ID="UserEmail2">请您务必填写正确的E-mail地址,便于我们与您联系;</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">真实姓名: </FONT></div></TD>
<TD>
<INPUT NAME="realname" TYPE="text" ID="realname2">收货人姓名。</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">身份证号码: </FONT></div></TD>
<TD>
<input name="identify" type="text" id="QQ3" onKeyPress = "return regInput(this, /^\d*\.?\d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^\d*\.?\d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^\d*\.?\d{0,2}$/, event.dataTransfer.getData('Text'))">此项信息用于必要时以核实身份,一经注册,便不可更改,请如实填写!</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">移动手机: </FONT></div></TD>
<TD>
<input name="mobile" type="text" id="QQ4" onKeyPress = "return regInput(this, /^\d*\.?\d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^\d*\.?\d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^\d*\.?\d{0,2}$/, event.dataTransfer.getData('Text'))">请填写正确的号码,以便有急事联系。</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00"> Q Q:</FONT> </div></TD>
<TD>
<input name="QQ" type="text" id="QQ" onKeyPress = "return regInput(this, /^\d*\.?\d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^\d*\.?\d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^\d*\.?\d{0,2}$/, event.dataTransfer.getData('Text'))">网上联系</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR=#cb6f00>密码提示: </FONT></div></TD>
<TD>
<INPUT NAME="UserQuestion" TYPE="text" ID="UserQuestion2">
</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR=#cb6f00>密码答案: </FONT></div></TD>
<TD>
<INPUT NAME="UserAnswer" TYPE="text" ID="UserAnswer2">
</TD>
</TR>
<TR>
<TD colspan="2" align="center">
<INPUT TYPE="submit" ONCLICK="return check();" NAME="RegSubmit" STYLE="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee"VALUE="提交" >
<input type="reset" name="Submit5" STYLE="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee" value="清除">
<script language="JavaScript">
<!--
function check()
{
if(checkspace(document.userinfo.UserName.value)) {
document.userinfo.UserName.focus();
alert("用户名不能为空,请重新输入!");
return false;
}
if(checkspace(document.userinfo.UserName.value) || document.userinfo.UserName.value.length < 2) {
document.userinfo.UserName.focus();
alert("用户名长度不能小于2,请重新输入!");
return false;
}
if(checkspace(document.userinfo.identify.value) || document.userinfo.identify.value.length < 15) {
document.userinfo.identify.focus();
alert("身份证号码长度不能小于15位,请重新输入!");
return false;
}
if(checkspace(document.userinfo.UserPassword.value) || document.userinfo.UserPassword.value.length < 6) {
document.userinfo.UserPassword.focus();
alert("密码长度不能小于6,请重新输入!");
return false;
}
if(document.userinfo.UserPassword.value != document.userinfo.UserPassword1.value) {
document.userinfo.UserPassword.focus();
document.userinfo.UserPassword.value = '';
document.userinfo.UserPassword1.value = '';
alert("两次输入的密码不同,请重新输入!");
return false;
}
if(document.userinfo.UserEmail.value.length!=0)
{
if (document.userinfo.UserEmail.value.charAt(0)=="." ||
document.userinfo.UserEmail.value.charAt(0)=="@"||
document.userinfo.UserEmail.value.indexOf('@', 0) == -1 ||
document.userinfo.UserEmail.value.indexOf('.', 0) == -1 ||
document.userinfo.UserEmail.value.lastIndexOf("@")==document.userinfo.UserEmail.value.length-1 ||
document.userinfo.UserEmail.value.lastIndexOf(".")==document.userinfo.UserEmail.value.length-1)
{
alert("Email地址格式不正确!");
document.userinfo.UserEmail.focus();
return false;
}
}
else
{
alert("Email不能为空!");
document.userinfo.UserEmail.focus();
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</script> <br>
<br>
<br></TD>
</TR>
</TABLE>
</FORM></td>
</tr>
</table>
<!--#include file="foot.htm"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -