⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newlogin.asp

📁 这是一本关于高级软件工程的书籍
💻 ASP
字号:
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/function.asp" -->
<%
	stat = managestr(request("stat"))
	if stat <> "" then
		username = managestr(request("username"))
		uname = managestr(request("uname"))
		password = managestr(request("password"))
		email = managestr(request("email"))
		phone = managestr(request("phone"))
		address = managestr(request("address"))
		postalcode = managestr(request("postalcode"))
		sql = "select username from people where username='"&username&"'"
		rs.open sql,conn
		if rs.eof then
			sql = "INSERT INTO people(username,password,uname,phone,email,postalcode,address)VALUES ('"&username&"','"&password&"','"&uname&"','"&phone&"','"&email&"','"&postalcode&"','"&address&"')"
			conn.execute(sql)
		else
			stat="3"
		end if
		rs.close
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>意科在线定单系统</title>
<style>
.w-1 {
	font-family: "宋体";
	font-size: 12px;
	color: #FFFFFF;
	background-position: bottom;
}

.w-2 {
	font-family: "宋体";
	font-size: 12px;
	color: #cccccc;
	background-position: bottom;
}

.w-3 {
	font-family: "宋体";
	font-size: 12px;
	color: #000000;
	background-position: bottom;
}
</style>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <!-- #include file="../inc/qhead.asp" -->
  <table width="737" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="666666">
  <tr>
    <td height="20" colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td width="170" height="20" valign="top" bgcolor="606060"><!-- #include file="../inc/left.inc" --></td>
    <td width="8">&nbsp;</td>
	<form name="logform" action="newlogin.asp" method="post">
	<input type="hidden" name="stat" value="1">
    <td width="559" valign="top">
	  <table width="100%" border="0">
        <tr>
          <td bgcolor="#CCCCCC" class="w-3" valign="bottom"><strong>新用户注册:</strong>
		  	<%
				if stat = "1" then
					response.write "<font color=red><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注册成功!</b></font>"
				elseif stat = "3" then
					response.write "<font color=red><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;该用户名已经存在,请换一个用户名!</b></font>"
				end if
			%>		  </td>
          </tr>
      </table>
	  <hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">您的会员帐号:</td>
          <td width="83%"><label>
            <input name="username" type="text" id="username" size="15" maxlength="20">
          </label></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%"><label>【这是您登陆的名字】</label></td>
        </tr>
      </table><hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">您的姓名:</td>
          <td width="83%"><input name="uname" type="text" id="uname" size="15" maxlength="30"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【请您留下您的真是姓名,便于我们与您联系及发货】</td>
        </tr>
      </table><hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">密码:</td>
          <td width="83%"><input name="password" type="password" id="password" size="15" maxlength="20"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【长度太小的密码很不安全,而长度太大的密码又不方便记忆,所以请您将密码的长度限制在4-16个字符之间。密码的组成元素只能是英文字母、数字。例如:sms2000等】</td>
        </tr>
      </table><hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">密码确认:</td>
          <td width="83%"><input name="cpassword" type="password" id="cpassword" size="15" maxlength="20"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【请您在“密码确认”方框中输入于“密码”想通的信息,这是为了防止设置密码时输入错误。】</td>
        </tr>
      </table><hr>
      <table width="100%" border="0"class="w-1" >
        <tr>
          <td width="17%">E-MAIL:</td>
          <td width="83%"><input name="email" type="text" id="email" size="25" maxlength="30"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【请您填上正确的电子邮件地址,这样我们才方便与您联系。如果您有两个以上邮箱,请只填写您最常用的一个邮箱地址。】</td>
        </tr>
      </table><hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">常用电话:</td>
          <td width="83%"><input name="phone" type="text" id="phone" size="15" maxlength="15"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【请填写能随时联系到您的电话,以便您在购物后我们能随时与您取得联系。】</td>
        </tr>
      </table><hr>
      <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">收货地址:</td>
          <td width="83%"><input name="address" type="text" id="address" size="50" maxlength="50"></td>
        </tr>
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%">【请填写您能最直接收到货物的地址,以便我们能尽快将您所构买的商品邮递给您】</td>
        </tr>
      </table><hr>
	  <table width="100%" border="0" class="w-1">
        <tr>
          <td width="17%">邮编:</td>
          <td width="83%"><input name="postalcode" type="text" id="postalcode" size="15" maxlength="6"></td>
        </tr>
      </table><hr><br>
      <table width="200" border="0" align="right">
        <tr>
          <td width="144"><div align="right" class="w-1"><a style='cursor:hand' onClick="check()"><img src="../pic/log.jpg" border="0"></a></div></td>
          <td width="46">&nbsp;</td>
        </tr>
      </table>
      <br><br><br><br><br><br><br></td>
	  </form>
  </tr>
</table>
<!-- #include file="../inc/bottom.asp" -->
<script language="javascript">
function isMadeOf(val,str){
	var jj;
	var chr;
	for (jj=0;jj<val.length;++jj){
		chr=val.charAt(jj);
		if (str.indexOf(chr,0)==-1)
			return false;
		}
		return true;
	}
	
	function forPhone(obj){
		var phoneStr= "()-#0123456789";
		if (!isMadeOf(obj.value,phoneStr)){
			flag = 1;
			return false;
		}
		return true;
	}
	
	function forPostalcode(obj){
		var postalcode= "0123456789";
		if (!isMadeOf(obj.value,postalcode)){
			flag = 1;
			return false;
		}
		return true;
	}
	
	function verifyUsername(strUsername){
		var myReg = /^[_a-zA-Z0-9_-_@_._.]+\w$/;
		if(myReg.test(strUsername))
			return true;
		else
			return false;
	}
	function isEmail(s){
		if (s.length > 100)
			return false;
		var regu="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$";  
		var re = new RegExp(regu);
		if (s.search(re) != -1)
			return true;
		else 
			return false;
	}

	function check(){
		if(document.logform.username.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("会员帐号不能为空!");
			document.logform.username.focus();
			return false;
		}
		if(document.logform.uname.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("用户姓名不能为空!");
			document.logform.uname.focus();
			return false;
		}
		if(document.logform.password.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("登陆密码不能为空!");
			document.logform.password.focus();
			return false;
		}
		if(!verifyUsername(document.logform.password.value)){
			alert("登陆密码不正确!应为英文或数字组成!");
			document.logform.password.focus();
			return false;
		}
		if(document.logform.password.value!=document.logform.cpassword.value){
			alert("密码和确认密码填写的内容不一样,请从新填写!");
			document.logform.password.focus();
			return false;
		}
		if(document.logform.email.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("Email不能为空!");
			document.logform.email.focus();
			return false;
		}
		if(document.logform.email.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
			if(!isEmail(document.logform.email.value)){
				alert("Email输入有误,请检查!");
				document.logform.email.focus();
				return false;
			}
		}
		if(document.logform.phone.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("电话不能为空!");
			document.logform.phone.focus();
			return false;
		}
		if(document.logform.phone.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
			if(!forPhone(document.logform.phone)){
				alert("电话值不正确!请填写数字,可以包含(,),-,#符号");
				document.logform.phone.focus();
				return false;
			}
		}
		if(document.logform.postalcode.value.replace(/(^\s*)|(\s*$)/g, "")==""){
			alert("邮编不能为空!");
			document.logform.postalcode.focus();
			return false;
		}
		if(document.logform.postalcode.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
			if(!forPostalcode(document.logform.postalcode)){
				alert("所填邮编不正确!请填写数字");
				document.logform.postalcode.focus();
				return false;
			}
		}
		document.logform.submit();
	}
</script>
<script language="javascript">
	document.lefform.pagestr.value="newlogin.asp";
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -