REG_SAVE.ASP
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="GENERAL.CSS" rel="stylesheet" type="text/css">
<!--#include file="conn.asp"-->
<%
dim user
user=request.Form("name")
set rs=server.createobject("adodb.recordset")
sql="select * from user_name where name='"&user&"' "
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
%>
<title>江汉热线职员签到系统</title><table width="607" border="0" align="center"
if (document.form1.pwd.value.length < 6)
{
alert("密码至少6位!");
return false;
}
if (document.form1.pwd.value != document.form1.pwd1.value)
{
alert("两次输入的密码不相同!");
return false;
}
if (document.form1.pwd_ask.value=="")
{
alert("提示问题不能为空!");
return false;
}
if (document.form1.pwd_answer.value=="")
{
alert("回答问题不能为空!");
return false;
}
if (document.form1.address.value=="")
{
alert("地址不能为空!");
return false;
}
if (document.form1.post.value=="")
{
alert("邮编不能为空!");
return false;
}
if (document.form1.qq.value=="")
{
alert("QQ不能为空!");
return false;
}
if (document.form1.age.value=="")
{
alert("年龄不能为空!");
return false;
}
if (document.form1.age_year.value=="")
{
alert("出生年月不能为空!");
return false;
}
if (document.form1.ident.value=="")
{
alert("身份证号码不能为空!");
return false;
}
if (document.form1.mail.value=="")
{
alert("邮件地址不能为空!");
return false;
}
// if (!chkemail(document.form1.mail.value))
// {
// alert("Email地址不正确!");
// return false;
// }
// if (!confirm('注意:请确保您的信箱有效,否则无法收到回复确认信。是否继续?')) return false;
return true;
}
//检查Email地址格式
function chkemail(a)
{
var i=a.length;
var temp = a.indexOf('@');
var tempd = a.indexOf('.');
if (temp > 1) {
if ((i-temp) > 3){
if (tempd!=-1){
return 1;
}
}
}
return 0;
}
//检查字符串
function fucCheckSTR(NUM)
{
var i,j,strTemp;
strTemp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
if ( NUM.length== 0)
return 0
for (i=0;i<NUM.length;i++)
{
j=strTemp.indexOf(NUM.charAt(i));
if (j==-1)
{
return 0;
}
}
return 1;
}
function resetForm() {
document.form1.reset();
}
</script>
<script language="javascript">
function IsNum(theField)
{
if (!IsNum2(theField.value))
{alert("这里只能输入数字!");
theField.value ="";
theField.focus();}
}
function IsNum2(s)
{
var Number = "0123456789.";
for (i = 0; i < s.length;i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (Number.indexOf(c) == -1) return false;
}
return true
}
</script>
login页
<%
uid = trim(request("uid"))
psd = trim(request("psd"))
set rs = server.CreateObject("adodb.recordset")
sql = "select * from adminlist where username = '"&uid&"'"
rs.open sql,conn,1,3
if not rs.eof then
if rs("password") = psd then
session.Timeout = 480
session("lv") = rs("lv")
session("id") = rs("id")
if trim(request("cookie")) = "1" then
Response.Cookies("erp")("lv")=rs("lv")
Response.Cookies("erp")("id")=rs("id")
Response.Cookies("erp").Expires=Date + 30
end if
response.Redirect("default.asp")
else
Response.Write "<script language='javascript'>window.confirm('对不起,密码不正确!!');</script>"
Response.Write "<script language='javascript'>parent.window.history.go(-1);</script>"
end if
else
Response.Write "<script language='javascript'>window.confirm('对不起,该用户不存在!!');</script>"
Response.Write "<script language='javascript'>parent.window.history.go(-1);</script>"
end if
conn.close
set conn = nothing
%>