?? login.asp
字號:
<!--#include file="config.inc"-->
<%
'On Error Resume Next
username=Request.form("name")
password=Request.form("password")
set conn=server.createobject("adodb.connection")
conn.open ConnString
strSql ="SELECT Member_id ,M_Last_Visited from Members where M_Name = '" & userName & "' and M_Password = '" & password &"'"
'Response.Write StrSql
set rs = conn.Execute (StrSql)
'記錄用戶登錄情況
if rs.BOF or rs.EOF then
logtype = "非法"
else
logtype = "合法"
end if
str = "insert into Login (L_Name, L_Type, L_IP) Values ('"
str = str & username & "', '"
str = str & logtype & "', '"
str = str & Request.ServerVariables("REMOTE_ADDR") & "')"
'Response.write str
conn.Execute (str)
if rs.BOF or rs.EOF then
%>
<html>
<head>
<TITLE>登錄錯誤</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet type=text/css href='style.css'>
</head>
<body>
<center><br><br>
<h2><font face="<% =SpecificFontFace %>" color="<% =DefaultFontColor %>">登錄錯誤</font></h2>
<br><font face="<% =DefaultFontFace %>" size="3">
<p>帳號“<font color="<% =SpecificFontColor %>"><% =username %></font>”不存在,或你輸入的密碼有誤。
<br><br>請檢查后重新輸入。</p>
</font>
<br>
<table border="1" cellspacing="0" cellpadding="2" bgcolor="<% =ButtonBgColor %>" bordercolorlight="#000000" bordercolordark="#FFFFFF" width="80" align="center">
<tr>
<td>
<div align="center" class="p9"><a href="<% =PageBaseHref %>"><font size=2>返回</font></a></div>
</td>
</tr>
</table>
</center>
</body>
</html>
<%
Else
'## save user infomation
session("user_id") = rs("Member_id")
session("last_visited") = rs("M_Last_Visited")
'refresh visit time
strSql = "update Members set M_Last_Visited = #" & Now() & "#, M_Visited_Times = M_Visited_Times+1 where M_Name = '" & userName & "'"
conn.Execute (StrSql)
'redirect to main.asp
Response.redirect("main.asp")
End if
rs.close
set rs=nothing
'## 關(guān)閉數(shù)據(jù)庫連接
conn.close
set conn=nothing
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -