<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<body>
<form id= "Form1" Name= "Form1" method= "Post" action= "" >
<label>
<input type= "text" name= "name" id= "TextField"/>
</label>
<p>
<label>
<input type= "text" name= "pwd" id= "Textfield2"/>
</label>
</p>
<p>
<label>
<input type= "Submit" name= "button" id= "button" value= "submitted"/>
</label>
</p>
</form>
</body>
<%
If Request.Form ("name") <> "then
Login ()
End If
function Login ()
Dim sql,username,userpwd,user
Username=html_encode (Request.Form ("name"))
Userpwd=html_encode (Request.Form ("pwd"))
User=request.form ("User")
If Len (username) <4 or len (username) >16 Then
Response.Write (' <script language= ' javascript tutorial ' >alert (' Sorry, username illegal! '); History.back ();</script> ")
Response.End
End If
If Len (userpwd) <4 or Len (userpwd) >16 Then
Response.Write (' <script language= ' JavaScript ' >alert (' Sorry, the password is illegal! '); History.back ();</script> ")
Response.End
End If
If CInt (user) <>session ("user") then
Response.Write (' <script language= ' JavaScript ' >alert (' Sorry, wrong captcha! '); History.back ();</script> ")
Response.End
End If
Sql= "SELECT * from Reg where username= '" &username& "' and password= '" &userpwd& "'"
Call Opensql ()
Sqlrs.open SQL,SQLCN
If not sqlrs.eof then
Session ("username") =username
Response.Redirect (".. /usermange.asp?user= "&username)
Else
Response.Write ("<script language= ' JavaScript ' >alert" Sorry, Login failed username does not exist, please try again!) '); History.back ();</script> ")
End If
End Function
' The first is to get the user's username and password, and then make a comparison of the data to judge, if it is not legal to query the database tutorial, if the validation of the rules to verify the database username and password verification, validation through the user name saved to the session, and then jump to the page we want to process.
%>