?? login.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%response.Buffer=true%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
strconn="DRIVER=Microsoft Access Driver (*.mdb);DBQ="& Server.MapPath("user.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
%>
</head>
<body>
<center>
<%
set rstemp=server.CreateObject("adodb.recordset")
dim strname,strpassword,sql
strname=request.Form("username")
strpassword=request.Form("password")
sql="select*from user where username='"&strname&"'"
rstemp.open sql,conn,1,3
if strname=""then
response.Write "賬號不能為空<p></p>"
%>
<a href=javascript:history.back()>上一頁</a>
<%
response.End
end if
if strpassword=""then
response.Write "密碼不能為空<p></p>"
%>
<a href=javascript:history.back()>上一頁</a>
<%
response.End
end if
if rstemp.RecordCount=1 then
if rstemp("password")=strpassword then
session("uesrname")=strname
response.Redirect"user.html"
else
%>
<a href=javascript:history.back()>密碼錯誤 請重新輸入</a>
<%
end if
else
%>
<a href=javascript:history.back()>賬號錯誤 請重新輸入</a>
<%
response.End
end if
rstemp.close
set rstemp=nothing
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -