?? reg.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'/*----------------------------------------------
'項目名: 東區網上書店(ASP課程設計)
'開始日期: 2003年12月18日18:00
'完成日期: 2003年12月27日53:00
'最后修改: -
'制作地點: 科干東區宿舍
'程序制作: 陳文杰
'聯系方式: QQ:168909
'
'
' Email:Cwj@edu.21cn.com
'
' *未經同意本程序不得使用!*
'
' 請尊重他人勞動成果,保留上面信息!
'-----------------------------------------------*/
%><!--#include file="manage/inc/config.asp"-->
<!--#include file="inc/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("password")=md5(trim(request("password")))
rs("useremail")=trim(request("useremail"))
rs("quesion")=trim(request("quesion"))
rs("answer")=md5(trim(request("answer")))
rs("realname")=trim(request("realname"))
'身份證
rs("identify")=trim(request("identify"))
rs("mobile")=trim(request("mobile"))
rs("userqq")=trim(request("userqq"))
rs("adddate")=now()
rs("lastvst")=now()
rs("loginnum")=0
rs("postcode")=0
rs("score")=0
rs("paymethord")=0
rs("deliverymethord")=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>東區網上書店</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #000000}
-->
</style>
</head>
<body>
<!--#include file="head.htm"-->
<table width="780" 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="password" TYPE="password" ID="password">
長度必須大于6個字符。</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR="#cb6f00">*確認密碼:</FONT> </div></TD>
<TD>
<INPUT NAME="password1" TYPE="password" ID="password1">
</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="userqq3" 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="userqq4" 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="userqq" type="text" id="userqq" 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="quesion" TYPE="text" ID="quesion2">
</TD>
</TR>
<TR>
<TD><div align="right"><FONT COLOR=#cb6f00>密碼答案: </FONT></div></TD>
<TD>
<INPUT NAME="answer" TYPE="text" ID="answer2">
</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.password.value) || document.userinfo.password.value.length < 6) {
document.userinfo.password.focus();
alert("密碼長度不能小于6,請重新輸入!");
return false;
}
if(document.userinfo.password.value != document.userinfo.password1.value) {
document.userinfo.password.focus();
document.userinfo.password.value = '';
document.userinfo.password1.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 + -