manage.asp
‘ ç»å½Â页é¢.xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /??
<%@ Language=VBScript %>
<html>
<body>
<form name=”Login” method=”Post” action=”login.asp”>
<input type=”text” name=”username” size=”20″>ç¨æ·åÂÂ<br>
<input type=”password” name=”password” size=”20″>å£令<br>
<input type=”submit” name=”btnLogin” value=”ç»当>
</form>
</body></html>
login.asp
‘ éªÂè¯Âå¨表åÂÂä¸Âè¾ÂÃ¥Â
¥çÂÂç¨æ·åÂÂÃ¥ÂÂå£令.
<%@ Language=VBScript %>
<% Response.Buffer = True %>
<html>
<body>
<% Session(“allow”) = True %>
<%
UserName = Request.Form(“username”)
Password = Request.Form(“password”)
‘ æÂÂÃ¥ÂÂ表åÂÂÃ¥ÂÂ
容.
Set MyConn=Server.CreateObject(“ADODB.Connection”)
MyConn.Open “è¿ÂæÂ¥åÂÂ符串“
SQL = “Select * From tblLogin”
Set RS = MyConn.Execute(SQL)
If UserName = RS(“UserName”) AND Password = RS(“Password”) Then
‘ å¦ÂæÂÂå¹éÂ
ÂÃ¥ÂÂæ¾示è¦Âä¿Âæ¤çÂÂ页é¢.
%>
—————————————————————————————————————-
‘ æ¤å¤Âæ¾置è¦Âä¿Âæ¤çÂÂ页é¢çÂÂÃ¥ÂÂ
容.
—————————————————————————————————————-
<%
Else
Response.Redirect “http://www.intels.net/login.asp”
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
End If
%>
‘ å¦ÂæÂÂä¸Âå¹éÂ
ÂÃ¥ÂÂè¿ÂÃ¥ÂÂç»å½Â页,让ç¨æ·éÂÂæ°ç»å½Â.
</body></html>
ààà好äºÂï¼Â让æÂÂ们æÂ¥åÂÂæÂÂÃ¥ÂÂçÂÂåºÂç¨工ä½Âå§ï¼ÂæÂÂä¸Âé¢çÂÂ代ç Âå åÂ
¥éÂÂè¦Âä¿Âæ¤çÂÂ页é¢çÂÂæÂÂÃ¥ÂÂé¢ï¼Â
<%@ Language=VBScript %>
<% Response.Buffer = True %>
<% If session(“allow”) = False Then Response.Redirect “manage.asp” %>
[1]