?? login.asp
字號:
<link href="style.css" type="text/css" rel="stylesheet">
<!--#include file="conn.asp"-->
<% if request("login")<>"" then
if request("usertype")<>"" then '用戶類型不空,核實(shí)數(shù)據(jù)真實(shí)
If Request("usertype")="yk" Then
Session("usertype")="yk"
response.Write"<script>alert('來自"&Request.ServerVariables("REMOTE_ADDR")&"的游客,歡迎光臨!');window.location.href='index.asp'</script>"
end if
If Request("usertype")="user" Then
sql = "select * from u where name='"&request("name")&"' and pwd='"&request("pwd")&"'"
Else
sql = "SELECT * FROM admin WHERE name='"&Request("name")&"' and pwd='"&Request("pwd")&"'"
End If
Set rs=db.execute(sql)
If not rs.EOF Or Not rs.BOF Then '輸入數(shù)據(jù)存在
If Request("usertype")="user" Then
If rs("lock") Then
response.Write"<script>alert('用戶被鎖定或者未開通!');window.location.href='login.asp'</script>"
else
Session("usertype")="user"
Session("userid")=rs("id")
Session("name")=rs("name")
Response.Redirect("index.asp")
end if
Else
Session("usertype")="admin"
Session("adminid")=rs("id")
Session("name")=rs("name")
Response.Redirect("index.asp")
End If
Else
response.Write"<script>alert('輸入錯誤!');window.location.href='login.asp'</script>"
rs.close
End if
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>lib</title>
</head>
<body>
<form name="form" method="POST" action="" >
<table width="333" height="133" border="0" align="center" cellpadding="4" cellspacing="1" >
<tr class="header" align="center">
<td height="26" colspan="2"><strong>用戶登陸</strong> </td>
</tr>
<tr >
<td width="30%" nowrap > 用戶名:</td>
<td>
<input name="name" type="text">
</td>
</tr>
<tr >
<td nowrap >密碼:</td>
<td>
<input name="pwd" type="password" id="Text1" >
</td>
</tr>
<tr >
<td nowrap >用戶類別:</td>
<td><select name="usertype" id="select" >
<option value="yk">游客</option>
<option value="user" >普通用戶</option>
<option value="admin">管理員</option>
</select></td>
</tr>
<tr >
<td nowrap><a href="reg.asp" target="right">注冊</a> </td>
<td>
<input type="submit" value="登陸">
<input type="reset" value="重寫"></td><input type="hidden" name="login" value="form">
</tr>
</table></form></body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -