📄 personup.asp
字号:
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/function.asp" -->
<%
stat = managestr(request("stat"))
if stat <> "" then
uname = managestr(request("uname"))
password = managestr(request("password"))
phone = managestr(request("phone"))
email = managestr(request("email"))
postalcode = managestr(request("postalcode"))
address = managestr(request("address"))
sql = "UPDATE people SET uname = '"&uname&"', password = '"&password&"', phone = '"&phone&"', email = '"&email&"', postalcode = '"&postalcode&"', address = '"&address&"' where username='"&session("username")&"'"
conn.execute(sql)
end if
sql = "SELECT username, password, uname, phone, email, postalcode, address FROM people where username='"&session("username")&"'"
rs.open sql,conn
if not rs.eof then
susername = rs("username")
suname = rs("uname")
sphone = rs("phone")
semail = rs("email")
spostalcode = rs("postalcode")
saddress = rs("address")
spassword = rs("password")
end if
rs.close
%>
<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"> </td>
</tr>
<tr>
<td width="170" height="20" valign="top" bgcolor="606060"><!-- #include file="../inc/left.inc" --></td>
<td width="8"> </td>
<form name="logform" action="personup.asp" method="post">
<input type="hidden" name="stat" value="1">
<td width="559" valign="top">
<table width="100%" border="0">
<tr>
<td valign="bottom" bgcolor="#CCCCCC" class="w-3"><strong>用户信息修改:</strong>
<%
if stat = "1" then
response.write "<font color=red><b> 您的信息已经修改成功!</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" value="<%=susername%>" readonly="true">
</label></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=suname%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=spassword%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=spassword%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=semail%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=sphone%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=saddress%>"></td>
</tr>
<tr>
<td width="17%"> </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" value="<%=spostalcode%>"></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/up.jpg" border="0"></a></div></td>
<td width="46"> </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;
}
}
if(document.logform.address.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("地址不能为空!");
document.logform.address.focus();
return false;
}
document.logform.submit();
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -