?? login.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
if Request.Form("formsubmit") = "true" Then
'登陸
username = trim(Request.Form("username"))
pwd = trim(Request.Form("pwd"))
if username = "" OR pwd = "" Then
Response.write "<script>alert('請輸入合法的用戶名密碼!');history.back(-1);</script>"
Response.End
End if
sql = "SELECT username, password FROM admin WHERE username = '"&username&"'"
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof OR rs.bof Then
Response.write "<script>alert('用戶名不存在!');history.back(-1);</script>"
Response.End
End if
if rs("password") <> pwd Then
Response.write "<script>alert('密碼輸入錯誤!');history.back(-1);</script>"
Response.End
Else
Session("admin") = "true"
Response.redirect "admin.asp"
End if
End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Login - Admin</title>
<style type="text/css">
body{font-size:12px; color:#CCCCCC; margin:0; padding:0; background:#000000;}
#global{margin:0 auto; width:500px; text-align:center; line-height:30px; padding:0;}
.input{border:1px solid #666666; color:#666666; background:#000000;}
.bt{border:1px solid #666666; color:#666666; background:#000000;}
</style>
</head>
<body>
<div id="global">
<form name="form1" method="post">
<div align="center"><img src="img/logo.jpg" width="274" height="228" align="middle" /></div>
<p>用戶名:
<input type="text" name="username" size="50" class="input" />
<br />
密 碼:
<input type="password" name="pwd" value="" size="50" class="input" />
<br />
<input type="submit" value="Login" class="bt" />
<input type="hidden" name="formsubmit" value="true" />
</p>
</form>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -