📄 accountform.asp
字号:
<%@ Language=VBScript %>
<!--#INCLUDE FILE = "include/shop.asp" -->
<% REM ######################################################################### %>
<% REM %>
<% REM accountform.ASP %>
<% REM 用户注册和修改 %>
<% REM EPRO E-Commerce Solution 1.0 %>
<% REM Copyright (c) 1999-2000 EPRO(GUANGZHOU) Co,Ltd. All rights reserved. %>
<% REM %>
<% REM ######################################################################### %>
<%
redirecturl=Request("goto")
action=Request("action")
loginstep=Request("loginstep")
if action="add" and loginstep<>2 then
Response.Redirect "shengming.asp?action=add&goto=" & redirecturl
end if
dim errList
if isnull(ShopperID) or isempty(ShopperID) then
if action<>"add" then
errorList="用户未登录。<br>"
end if
else
cmdTemp.CommandText = "SELECT * FROM shopper where shortname='" & ShopperID & "'"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.Open cmdTemp, , adOpenKeyset, adLockOptimistic
if not rs.EOF then
id=rs("shortname")
name=rs("fullname")
pa=rs("password")
sex=rs("sex")
y=year(rs("birthday"))
m=month(rs("birthday"))
d=day(rs("birthday"))
edu=rs("education")
idcard=rs("idcard")
career=rs("career")
que=rs("question")
ans=rs("answer")
stre=rs("street")
cit=rs("city")
pro=rs("province")
coun=rs("country")
pho=rs("phone")
ema=rs("email")
zip=rs("zip")
end if
end if
%>
<% if errorList<>"" then %>
<!--#INCLUDE FILE="include/error.asp" -->
<%else %>
<html>
<head>
<title>网上购物: 用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL=stylesheet HREF="shop.css" TYPE="text/css">
</style>
</head>
<script language="JavaScript">
<!--
function Juge(theForm)
{
if (theForm.id.value == "")
{
alert("请输入您的代号!");
theForm.id.focus();
return (false);
}
if (checktext(theForm.id.value))
{
alert("请您输入有效的代号!");
theForm.id.select();
theForm.id.focus();
return (false);
}
if (theForm.name.value == "")
{
alert("请输入您的真实姓名!");
theForm.name.focus();
return (false);
}
if (theForm.pa.value == "")
{
alert("请输入您的密码!");
theForm.pa.focus();
return (false);
}
if ((theForm.pa.value) != (theForm.paa.value))
{
alert("您输入的密码与确认密码不符!");
theForm.pa.select();
theForm.pa.focus();
theForm.paa.value="";
return (false);
}
if (theForm.y.value!="" && (isNaN(theForm.y.value) || ( theForm.y.value <= 1900) || (theForm.y.value > 2000 ))) {
alert("请输入正确的生日年份!!");
theForm.y.select();
theForm.y.focus();
return (false);
}
if (theForm.day.value!="" && (isNaN(theForm.day.value) || theForm.day.value < 1 || theForm.day.value > 31 )) {
alert("请输入正确的生日月份!!");
theForm.day.select();
theForm.day.focus();
return (false);
}
if (checktext(theForm.name.value))
{
alert("请您输入有效的真实姓名!");
theForm.name.select();
theForm.name.focus();
return (false);
}
if (theForm.card.value!="" && isNaN(theForm.card.value))
{
alert("您输入的身份证号必须为数字!");
theForm.card.focus();
return (false);
}
if (theForm.que.value == "")
{
alert("请输入提问问题!");
theForm.que.focus();
return (false);
}
if (theForm.awn.value == "")
{
alert("请输入提问答案!");
theForm.awn.focus();
return (false);
}
if (theForm.cst.value == "")
{
alert("请输入您的联系地址!");
theForm.cst.focus();
return (false);
}
if (theForm.cit.value == "")
{
alert("请输入您的城市!");
theForm.cit.focus();
return (false);
}
if (theForm.zip.value == "")
{
alert("请输入您的邮政编码!");
theForm.zip.focus();
return (false);
}
if (theForm.ph.value == "")
{
alert("请输入您的电话!");
theForm.ph.focus();
return (false);
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
var checkStr = theForm.ema.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
address=theForm.ema.value;
if(address.length>0)
{
i=address.indexOf("@");
if(i==-1)
{
window.alert("对不起!您输入的电子邮件地址是错误的!")
theForm.ema.focus();
return false
}
}
if (theForm.ema.value!="" && checktext(theForm.ema.value))
{
alert("请您输入有效的电子邮件地址!");
theForm.ema.select();
theForm.ema.focus();
return (false);
}
}
function checktext(text)
{
allValid = true;
for (i = 0; i < text.length; i++)
{
if (text.charAt(i) != " ")
{
allValid = false;
break;
}
}
return allValid;
}
function checknum(obj)
{
var num=obj.value;
if (isNaN(num))
{
alert("请用阿拉伯数字填写!注意不要填入空格和字母!");
obj.focus();
obj.select();
return (false);
}
if (num<=0)
{
alert("请填写有效数字!");
obj.focus();
obj.select();
return (false);
}
}
//-->
</SCRIPT>
<body topMargin="0">
<!--#INCLUDE FILE = "include/toolbar.asp" -->
<p>
<div align="center">
<center>
<table width="650" cellspacing=0 cellpadding=0 border=0>
<tr>
<td valign=top width="650">
1.请如实填写您的个人资料;<br>
2.凡带<font color="red">*</font>号为必填项。
<p>
</td>
</tr>
<tr>
<td valign=top width="650">
<FORM method="POST" ACTION="account.asp" name="theform" onSubmit="return Juge(this)" >
<input type="hidden" name="action" value=<%=request("action")%>>
<p>
<table cellpadding=0 cellspacing=0 border=0 bgcolor="#3366CC">
<tr>
<td></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -