Checkuser.asp
<%@ Language=VBScript %>
<%
dim Nick,Password
Nick=Request.Form("Nick")
Password=Request.Form("Password")
If Password="" OR Nick="" then
Response.Write "
登錄名或密碼沒有輸入,
36、"&_
"按這里返回"
Set Conn=Nothing
Response.End
Else
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=db1; UID=test; PWD=123456"
sql="Select Password,UserID From Users "&_
"Where Nick='"&Nick&"'"
Set rs=Server.CreateObject("ADODB.Reco
37、rdset")
rs.Open sql,Conn,0,1
If rs.BOF AND rs.EOF Then
Response.Write "
登錄名不存在,"&_
"按這里返回"
rs.Close
Set rs=Nothing
Set Conn=Nothing
Response.End
End if
If rs("Password")<>Password Then
Response.Write "
返回"
rs.Close
Set rs=Nothing
Set Conn=Nothing
Response.End
End if
Session("Nick")=Nick
Session("UserID")=rs("UserID")
rs.Close
Set rs=Nothing
Set Conn=Nothing
Response.Redirect "Products.asp"
End if
%>
Register.asp
39、content="zh-cn">
新客戶注冊(cè)
新客戶注冊(cè)
昵稱:
41、="Nick">**
密碼:
**
密碼確認(rèn):
42、 width="78%">
**
真實(shí)姓名:
**
電子郵件:
**
省份:
44、idth="22%" align="right" height="30">都市:
具體地址:
45、r>
郵政編碼:
聯(lián)系電話:
**
(注:有**
47、ont>
標(biāo)記的項(xiàng)目必須填寫?。?/font>
Checkregi.asp
<%@ Language=VBScript %>
<%
Dim Nick,Name,Password,Email
Dim Province,City,Address,Zip,Phon
Nick=Trim(Request.Form("Nick"))
Name=Trim(Request.Form("Name"))
Password=Trim(Request.Form("Password"))
rePass=Trim
48、(Request.Form("rePass"))
Email=Trim(Request.Form("Email"))
Province=Trim(Request.Form("Province"))
City=Trim(Request.Form("City"))
Address=Trim(Request.Form("Address"))
Zip=Trim(Request.Form("Zip"))
Phon=Trim(Request.Form("Phon"))
If Nick="" OR Name="" OR Password="" OR rePass=""_
OR Email="
49、" OR Phon="" then
ShowMessage "有必填項(xiàng)目沒有填寫!"
Set Conn=Nothing
Else
If Password<>rePass Then
ShowMessage "兩次輸入的密碼不同樣!"
Set Conn=Nothing
End if
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=db1; UID=test; PWD=123456"
Set rs = Server.CreateObject("ADODB.Recor
50、dset")
sql="Select * From Users Where Nick='"&Nick&"'"
rs.Open sql,Conn,0,1
If rs.EOF AND rs.BOF Then
sql="Insert Into Users(Nick,Password,Name,Email,"&_
"Province,City,Address,Zip,Phon)"&_
"Values('"&Nick&"','"&Password&"','"&Name&_
"','"&Email&"','"&Province&"','"&City&_
"','"&Addr
51、ess&"','"&Zip&"','"&Phon&"')"
Conn.Execute sql
rs.Close
Set rs=Nothing
Set Conn=Nothing
Response.Write "
"
Response.Redirect "Products.asp"
Else
rs.Close
Set rs=Nothing
Set Conn=Nothing
ShowMessage "此登錄名已被注冊(cè)!"
End if
End if
%>
'顯示返回重新填寫信息的程序過程
<%Sub ShowMessage(msg)%>