1、用户登录表单
<html>
<body>
<p align="center"><font face="华文行楷" size="6" color="#FF0000">用户登录界面</font></p>
<hr>
<form method="POST" action="check.asp">
<p align="center">用户名 <input type="text" name="xm" size="20">
密码 <input type="password" name="psw" size="20"></p>
<p align="center"><input type="submit" value="登录" name="ok"> <input type="submit" value="注册" name="ok">
<input type="reset" value="全部重写" name="B2"></p>
</form>
<hr>
</body>
</html>
2、检查用户登录信息(Ceck.asp)
<% @language=Vbscript %>
<%
If Request("ok")="登录" Then
nName=Trim(Request("XM"))
nPsw=Trim(Request("Psw" ))
If nName<>Empty And nPsw<>Empty Then
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open"Provider=MSDASQL;Driver={SQL Server};_
Server=dq;DataBase=BookOnline;Uid=sa;PWD=1234"
sqlStr="Select * From Customer,&_
“Where Customer_Name='"&nName&"' _
And Password='"&nPsw&"'"
Set rsConn=Server.CreateObject("ADODB.RecordSet")
rsConn.Open sqlStr,objConn,2,3,1
If rsConn.Eof Then
Session("Check")=0
Response.Write "密码与用户名不正确!请重新输入!<A href=login.htm>返回</A>"
Else
Session("Check")=1
Response.Redirect "mm.asp"
End if
Else
Response.Write "密码与用户名不能为空!<A href=login.htm>返回</A>"
Response.End
End if
ElseIf Request("ok")="注册" Then
Response.Redirect "Regist.htm"
End If
%>
3、用户注册表单(Regist.asp)
<html>
<head>
</head>
<body>
<p align="center"><font face="华文行楷" size="6" color="#FF0000">用户注册界面</font></p>
<hr>
<BR>
<form method="POST" action="regch.asp">
<p>客户编号 <input type="text" name="BH" size="20"> 客户姓名 <input type="text" name="XM" size="20">
密码<input type="password" name="PSW" size="10">验证<input type="password" name="PSW1" size="10"><br>
身份证号 <input type="text" name="SFZH" size="20"> 教育程度 <select size="1" name="XL">
<option>专科</option>
<option>本科</option>
<option>硕士</option>
<option>工人</option>
</select> 通信地址 <input type="text" name="TXDZ" size="29"><br>
邮政编码 <input type="text" name="YZBM" size="20"> 联系电话 <input type="text" name="LXDH" size="14">
Email <input type="text" name="EMAIL" size="29"></p>
<p align="center"><input type="submit" value="注册" name="ok"> <font size="6"><input type="reset" value="重写" name="B2"></font></p>
</form>
<hr>
</body>
</html>
4、用户注册管理(Regch.asp)
<% @Language=VBscript %>
<%
If Request("ok")="注册" Then
nBh=Request("BH")
nName=Trim(Request("XM"))
nPsw1=Trim(Request("PSW"))
nPsw2=Trim(Request("PSW1"))
nSfzh=Request("SFZH")
nXl=Request("XL")
nTxdz=Request("TXDZ")
nYzbm=Request("YZBM")
nLxdh=Request("LXDH")
nEml=Request("EMAIL")
If nPsw1=nPsw2 And nPsw1<>Empty Then
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "Proider=MSDASQL;Driver={SQL Server};Server=g10;Database=BookOnline;UID=sa;PWD=1234"
SqlStr="Select * From Customer Where Customer_name='"&nName&"'"
Set rsConn=server.CreateObject("ADODB.RecordSet")
rsConn.Open SqlStr,objConn,2,3,1
If rsConn.Eof Then
rsConn.AddNew Array("Customer_ID","Customer_name","Password","CardId","Education","Address","Zip","TelePhone","Email"),_
Array(nBh,nName,nPsw1,nSfzh,nXL,nTxdz,nYzbm,nLxdh,nEml)
Response.Write "恭喜您已注册成功!<br> <A href=Login.Htm> 登录</A>"
Else
Reponse.Write "用户名以被其他用户占用,请重新输入! <A href=Regist.Htm> 返回</A>"
End if
Else
Response.Write "两次输入的密码不一样,请重新输入! <A href=Regist.Htm> 返回</A>"
End if
End If
%>
<html>
<body>
<p align="center"><font face="华文行楷" size="6" color="#FF0000">用户登录界面</font></p>
<hr>
<form method="POST" action="check.asp">
<p align="center">用户名 <input type="text" name="xm" size="20">
密码 <input type="password" name="psw" size="20"></p>
<p align="center"><input type="submit" value="登录" name="ok"> <input type="submit" value="注册" name="ok">
<input type="reset" value="全部重写" name="B2"></p>
</form>
<hr>
</body>
</html>
2、检查用户登录信息(Ceck.asp)
<% @language=Vbscript %>
<%
If Request("ok")="登录" Then
nName=Trim(Request("XM"))
nPsw=Trim(Request("Psw" ))
If nName<>Empty And nPsw<>Empty Then
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open"Provider=MSDASQL;Driver={SQL Server};_
Server=dq;DataBase=BookOnline;Uid=sa;PWD=1234"
sqlStr="Select * From Customer,&_
“Where Customer_Name='"&nName&"' _
And Password='"&nPsw&"'"
Set rsConn=Server.CreateObject("ADODB.RecordSet")
rsConn.Open sqlStr,objConn,2,3,1
If rsConn.Eof Then
Session("Check")=0
Response.Write "密码与用户名不正确!请重新输入!<A href=login.htm>返回</A>"
Else
Session("Check")=1
Response.Redirect "mm.asp"
End if
Else
Response.Write "密码与用户名不能为空!<A href=login.htm>返回</A>"
Response.End
End if
ElseIf Request("ok")="注册" Then
Response.Redirect "Regist.htm"
End If
%>
3、用户注册表单(Regist.asp)
<html>
<head>
</head>
<body>
<p align="center"><font face="华文行楷" size="6" color="#FF0000">用户注册界面</font></p>
<hr>
<BR>
<form method="POST" action="regch.asp">
<p>客户编号 <input type="text" name="BH" size="20"> 客户姓名 <input type="text" name="XM" size="20">
密码<input type="password" name="PSW" size="10">验证<input type="password" name="PSW1" size="10"><br>
身份证号 <input type="text" name="SFZH" size="20"> 教育程度 <select size="1" name="XL">
<option>专科</option>
<option>本科</option>
<option>硕士</option>
<option>工人</option>
</select> 通信地址 <input type="text" name="TXDZ" size="29"><br>
邮政编码 <input type="text" name="YZBM" size="20"> 联系电话 <input type="text" name="LXDH" size="14">
Email <input type="text" name="EMAIL" size="29"></p>
<p align="center"><input type="submit" value="注册" name="ok"> <font size="6"><input type="reset" value="重写" name="B2"></font></p>
</form>
<hr>
</body>
</html>
4、用户注册管理(Regch.asp)
<% @Language=VBscript %>
<%
If Request("ok")="注册" Then
nBh=Request("BH")
nName=Trim(Request("XM"))
nPsw1=Trim(Request("PSW"))
nPsw2=Trim(Request("PSW1"))
nSfzh=Request("SFZH")
nXl=Request("XL")
nTxdz=Request("TXDZ")
nYzbm=Request("YZBM")
nLxdh=Request("LXDH")
nEml=Request("EMAIL")
If nPsw1=nPsw2 And nPsw1<>Empty Then
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "Proider=MSDASQL;Driver={SQL Server};Server=g10;Database=BookOnline;UID=sa;PWD=1234"
SqlStr="Select * From Customer Where Customer_name='"&nName&"'"
Set rsConn=server.CreateObject("ADODB.RecordSet")
rsConn.Open SqlStr,objConn,2,3,1
If rsConn.Eof Then
rsConn.AddNew Array("Customer_ID","Customer_name","Password","CardId","Education","Address","Zip","TelePhone","Email"),_
Array(nBh,nName,nPsw1,nSfzh,nXL,nTxdz,nYzbm,nLxdh,nEml)
Response.Write "恭喜您已注册成功!<br> <A href=Login.Htm> 登录</A>"
Else
Reponse.Write "用户名以被其他用户占用,请重新输入! <A href=Regist.Htm> 返回</A>"
End if
Else
Response.Write "两次输入的密码不一样,请重新输入! <A href=Regist.Htm> 返回</A>"
End if
End If
%>