📄 add.asp
字号:
<!--#include file="../INC/err.asp" -->
<!-- #include file="../../connections/conndb.asp" -->
<html>
<head>
<title>会员新加入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet href="../images/style.css">
<script language=javascript>
<!--
function search_User()
{
var f = document.theform;
if(!f.userid.value)
{
alert("请先输入想要查找的帐号!");
f.userid.focus();
}
else
{
window.open('exist.asp?userid=' + f.userid.value,'','x=200,y=200,width=300,height=60');
}
}
function check(theform)
{
if (theform.userid.value=="") {
alert("帐号不能为空。");
theform.userid.focus();
return false;
}
var checkOKpass = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var checkStrpass = theform.userid.value;
var allValidpass = true;
for (i = 0; i < checkStrpass.length; i++)
{
ch = checkStrpass.charAt(i);
for (j = 0; j < checkOKpass.length; j++)
if (ch == checkOKpass.charAt(j))
break;
if (j == checkOKpass.length)
{
allValidpass = false;
break;
}
}
if (!allValidpass)
{
alert("您输入的 \"用户帐号\" 包含无效字符 !");
theform.userid.select();
theform.userid.focus();
return false;
}
if ( (theform.userid.value.length<4) || (theform.userid.value.length>12) ){
alert("用户ID应该在4到12位之间。");
theform.userid.focus();
return false;
}
if ( (theform.passwd.value.length<4) || (theform.passwd.value.length>12) ){
alert("密码应该在4到12位之间。");
theform.passwd.focus();
return false;
}
if (theform.passwd.value!=theform.passwd1.value)
{
alert("两次输入密码不一样。");
theform.passwd1.focus();
return false;
}
if (theform.linkman.value=="")
{
alert("请输入联系人");
theform.linkman.focus();
return false;
}
if (theform.address.value=="")
{
alert("请输入联系地址");
theform.address.focus();
return false;
}
if(!fucCheckTEL(theform.zip.value))
{ alert("请输入规范的邮编。");
theform.zip.focus();
return false;
}
if (theform.tel.value=="" && theform.mobile.value=="" )
{
alert("电话、手机必填其一");
theform.tel.focus();
return false;
}
if(!fucCheckTEL(theform.tel.value))
{ alert("请输入规范的电话!");
theform.tel.focus();
return false;
}
if(!fucCheckTEL(theform.fax.value))
{ alert("请输入规范的传真!");
theform.fax.focus();
return false;
}
if (theform.email.value.length>0 && !check_email(theform.email.value))
{
alert("请输入合法的email。");
theform.email.focus();
return false;
}
if (theform.memo.value.length>1000)
{
alert("公司简介超过1000字");
theform.memo.focus();
return false;
}
//检验Email有效性
function check_email(myint)
{
var checkstr=myint;
if (checkstr.charAt(0)=="@") {return false;}
if (checkstr.charAt(checkstr.length-1)=="@") {return false;}
if (checkstr.charAt(checkstr.length-1)==".") {return false;}
a_valid=0;
a_count=0;
d_valid=0;
for(i=0; i<checkstr.length; i++)
{
ch=checkstr.charAt(i);
if (ch=='@') {a_valid=1;a_count++;}
if (ch=='.') {d_valid=1;}
}
if (a_count>1) {return false;}
if (a_valid==1 && d_valid==1) {return true;}
else
{return false;}
}
function fucCheckTEL(TEL)
{
var i,j,strTemp;
strTemp="0123456789-()#, ;";
for (i=0;i<TEL.length;i++)
{
j=strTemp.indexOf(TEL.charAt(i));
if (j==-1)
{
//说明有字符不合法
return 0;
}
}
//说明合法
return 1;
}
function fucChecknum(TEL)
{
var i,j,strTemp;
strTemp="0123456789";
for (i=0;i<TEL.length;i++)
{
j=strTemp.indexOf(TEL.charAt(i));
if (j==-1)
{
//说明有字符不合法
return 0;
}
}
//说明合法
return 1;
}
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bordercolorlight="#6D8E4D" bordercolordark="#E6E4C4" bgcolor="#CCCCCC">
<form method="post" action="add1.asp" onsubmit="return check(theform)" name="theform">
<tr align="center" bgcolor="#B6CBEB">
<td height="24" colspan="2"><b> 会员新加入</b></td>
</tr>
<tr>
<td height="13" colspan="2" bgcolor="#FFFFFF"><font color=red>请注意:</font>
所填的联系方式必须是<font
color=red>正确</font>的,否则无法取得联系,所有<font color="red">*</font>都必填。</td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">会员ID:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="userid" id="userid" size=20 maxlength=20 >
<font color="red">*</font> <a href="javascript:search_User()"><font color="#FF0000">检测帐号是否被占用</font></a>
</td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">密 码:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="passwd" type="password" id="passwd" size=20 maxlength=20 >
<font color="red">*</font> </td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">确认密码:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="passwd1" type="password" id="passwd1" size=20 maxlength=20 >
<font color="red">*</font> </td>
</tr>
<tr>
<td width=15% height="24" align="right" bgcolor="#FFFFFF">公司名称:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="company" size=40 maxlength=50 >
</td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">联系人:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="linkman" size="20" maxlength=20 >
<font color="red">*</font> </td>
</tr>
<tr>
<td width=15% height="25" align="right" bgcolor="#FFFFFF">通讯地址:</td>
<td height="25" bgcolor="#FFFFFF"> <input name="address" size=40 maxlength=50 >
<font color="red">*</font> </td>
</tr>
<tr>
<td width=15% height="24" align="right" bgcolor="#FFFFFF">邮政编码:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="zip" size="20" maxlength=6 >
</td>
</tr>
<tr>
<td width=15% height="24" align="right" bgcolor="#FFFFFF">电 话:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="tel" size=40 maxLength=50>
<font color="red">*</font> 电话或手机必填其一</td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">手 机:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="mobile" id="mobile" size=40 maxLength=50>
</td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#FFFFFF">传 真:</td>
<td height="24" bgcolor="#FFFFFF"> <input name="fax" size=40 maxlength=50
> </td>
</tr>
<tr>
<td width="15%" height="24" align="right" bgcolor="#FFFFFF">Email:<br> </td>
<td height="24" bgcolor="#FFFFFF"> <input name="email" size=40 maxlength=50
> </td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF">网 址:<br> </td>
<td height="24" bgcolor="#FFFFFF"> <input name="http" id="http" value="Http://" size=40 maxlength=50
> </td>
</tr>
<tr>
<td width=15% height="2" align="right" valign="top" bgcolor="#FFFFFF"> <table width="100%" height="22" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right">会员描述:</td>
</tr>
</table></td>
<td height="2" bgcolor="#FFFFFF"> <textarea name="memo" cols="60" rows="8" id="memo"></textarea>
<font color="red"><br>
</font> 1000字以内</td>
</tr>
<tr>
<td width=15% align="right" bgcolor="#FFFFFF"><br> </td>
<td bgcolor="#FFFFFF" > <input name=Next type=submit value="注册提交" class="button">
<input name=Next2 class="button" type=reset value="全部重写"> <font color="#FF0000"><%=request("msg")%></font> </td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -