Data | database
<!--#include file= ". /conn.asp "-->
<%
Dim Rs,sql,x_name,x_pwd,x_count
If Request.Form ("do") = "OK" Then
If Request.Form ("user_name") = "" Then
Response.Write ("<script language= ' JavaScript" >alert (' Sorry, please enter username!\t '); History.go ( -1);</script> ")
Response.End ()
Else
X_name = Request.Form ("user_name")
End If
' ↑ The Renegade username is empty!
If Request.Form ("user_pwd") = "" Then
Response.Write ("<script language= ' JavaScript" >alert (' Sorry, please enter user password!\t '); History.go ( -1);</script> ")
Response.End ()
Else
X_pwd = Request.Form ("User_pwd")
End If
' ↑ Renegade User password is empty!
Set rs = Server.CreateObject ("Adodb.recordset")
Sql= "SELECT * from [user] where user_name= '" &x_name& "' and user_pwd= '" &x_pwd& "'"
Rs.Open sql,conn,1,1
If not Rs. Eof Then
Session ("S_name") =rs ("user_name")
Session ("S_shen") =rs ("Shenfen")
Session ("S_shi") =rs ("Shijian")
Response.Redirect "Infoin.asp"
Else
Response.Write ("<script language= ' JavaScript" >alert (' Sorry, user or password error!\t '); History.go ( -1);</script> ")
Response.End ()
End If
Else
%>
<title>--> System Login </title>
<style type= "Text/css" >
<!--
. Zi {
Font-family:arial, Helvetica, Sans-serif;
font-size:10pt;
}
-->
</style>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table width= "height=" 140 border= "0" align= "center" cellpadding= "0" cellspacing= "1" bgcolor= "#33CCFF" class= " Zi ">
<tr>
<TD colspan= "2" >--> system login </td>
</tr>
<form name= "Form1" method= "Post" action= "index.asp" >
<tr bgcolor= "#FFFFFF" >
<TD width= "><div" align= "Center" > Account number:</div></td>
<TD width= "239" >
<input name= "user_name" type= "text" id= "user_name" >
</td>
</tr>
<tr bgcolor= "#FFFFFF" >
<td><div align= "center" > Password:</div></td>
<td><input name= "user_pwd" type= "password" id= "User_pwd" ></td>
</tr>
<tr bgcolor= "#FFFFFF" >
<td> </td>
<td><input type= "Submit" name= "submit" value= "Login" >
<input type= "button" Name= "Submit" value= "Close" >
<input name= "Do" type= "hidden" id= "Do" value= "OK" ></td>
</tr>
</form>
<tr>
<TD colspan= "2" ><div align= "right" >v1.00</div></td>
</tr>
</table>
<%end if%>