📄 reg_customer_sav.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<%
dim conn
dim connstr
Set conn=Server.CreateObject("ADODB.Recordset")
connstr="Driver={Microsoft ODBC for Oracle};server=mylink;uid=system;pwd=system;"
%>
<html>
<head>
<title>添加客户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td {
font-size: 13px;
}
</style>
</head>
<body>
<div align="left"><!-- #include file="pagetop.asp" --></div>
<%
dim id,pw,pw2,cname,idcard,province,city,address,zipcode,telphone,mobilephone,email,remark,rs,date1,sql
set rs=server.createobject("adodb.recordset")
function IsValidEmail(user_mail)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(user_mail, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
if trim(request("1"))="0" then
errmsg=errmsg+"<br>"+"<li>您必须同意注册条约"
founderr=true
end if
if trim(request("id"))="" then
errmsg=errmsg+"<br>"+"<li>客户ID不能为空"
founderr=true
else
id=lcase(trim(request("id")))
end if
if trim(request("pw"))="" or trim(request("pw2"))="" then
errmsg=errmsg+"<br>"+"<li>输入密码或确认密码不能为空"
founderr=true
else
pw=lcase(trim(request("pw")))
pw2=lcase(trim(request("pw2")))
if pw <> pw2 then
errmsg=errmsg+"<br>"+"<li>输入密码与确认密码不同"
founderr=true
else if len(trim(request("pw")))<6 then
errmsg=errmsg+"<br>"+"<li>您输入的密码少于6位"
founderr=true
end if
end if
end if
sql="select user_id from GSCOTT.user_info_table where user_id='"&id&"'"
rs.open sql,connstr
if not rs.eof then
errmsg=errmsg+"<br>"+"<li>客户ID已被别人注册"
founderr=true
end if
rs.close
if trim(request("cname"))="" then
errmsg=errmsg+"<br>"+"<li>客户姓名不能为空"
founderr=true
else
cname=trim(request("cname"))
end if
if trim(request("province"))="" then
errmsg=errmsg+"<br>"+"<li>所在省份不能为空"
founderr=true
else
province=trim(request("province"))
end if
if trim(request("city"))="" then
errmsg=errmsg+"<br>"+"<li>所在城市不能为空"
founderr=true
else
city=trim(request("city"))
end if
if trim(request("address"))="" then
errmsg=errmsg+"<br>"+"<li>客户地址不能为空"
founderr=true
else
address=trim(request("address"))
end if
if trim(request("telphone"))="" then
errmsg=errmsg+"<br>"+"<li>联系电话不能为空"
founderr=true
else
telphone=trim(request("telphone"))
end if
idcard=trim(request("idcard"))
zipcode=trim(request("zipcode"))
mobilephone=trim(request("mobilephone"))
email=trim(request("email"))
if email<>"" then
if isvalidemail(email)=false then
errmsg=errmsg+"<br>"+"<li>你的E-mail有错误"
founderr=true
end if
end if
remark=trim(request("remark"))
%>
<div align="center">
<center>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<%
if founderr=false then
date1=cstr(now)
sql="select * from GSCOTT.user_info_table"
rs.open sql,connstr,3,3
rs.addnew
rs("user_id")=id
rs("user_password")=pw
rs("user_name")=cname
rs("user_idcard")=idcard
rs("user_province")=province
rs("user_city")=city
rs("user_address")=address
rs("user_zipcode")=zipcode
rs("user_telphone")=telphone
rs("user_mobilephone")=mobilephone
rs("user_email")=email
rs("user_date")=date1
rs("user_remark")=remark
rs.update
rs.close
set rs=nothing
%>
<tr><td height="20"></td></tr>
<tr>
<td height="20" align="center" bgcolor="#E4E2FE" colspan="3"><font color="#0000FF">客户信息添加成功</font></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">客户ID:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=id%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">密码:</div></td>
<td width="67%" height="20" colspan="2" align="center">请牢记您的密码</div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">客户姓名:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=cname%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">身份证号:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=idcard%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">所在省份:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=province%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">所在城市:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=city%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">客户地址:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=address%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">邮编:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=zipcode%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">联系电话:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=telphone%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">手机:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=mobilephone%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">Email:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=email%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">创建时间:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=date1%></div></td>
</tr>
<tr>
<td width="33%" height="20"><div align="right">备注:</div></td>
<td width="67%" height="20" colspan="2"><div align="center"><%=remark%></div></td>
</tr>
<tr><%session("user_name")=id%><meta http-equiv="refresh" content="5;url=index.asp">
<td height="20" colspan="3" align="center">五秒钟后自动返回到主页,如果您的浏览器没有返回,请<a href="index.asp" target="_self">单击此处</a>返回首页</td>
</tr>
<tr><td height="20"></td></tr>
<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<tr><td height="100"></td></tr>
<tr>
<td width="33%" height="20" align="center">客户信息有问题</td>
</tr>
<tr>
<td><%=errmsg%></td>
</tr>
<tr><td> </td></tr>
<tr><td align="center"><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请<a href="javascript:history.go(-1)">单击此处</a>返回</font></td></tr>
<tr><td height="100"></td></tr>
<%end if%>
</table>
<!-- #include file="pagefooter.html" -->
</center>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -