如何用Cookie进行登录验证?_编程10000问

login.htm
请注册登录随风起舞
<FORM ACTION="checklogin.asp" METHOD="POST">
    电子邮件: <input TYPE="Text" NAME="email" SIZE="40">
    密码: <input TYPE="Password" NAME="Password" SIZE="40">
    <input TYPE="Checkbox" NAME="SaveLogin" value="ON">您要将注册内容保存为Cookie吗?
    <input TYPE="Submit" VALUE="登录"><input TYPE="RESET">
</FORM>

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

checklogin.asp
<%
dim bLoginSaved
if Request("SaveLogin") = "on" then
    Response.Cookies("SavedLogin")("EMail") = Request("email")
    Response.Cookies("SavedLogin")("pw") = Request("password")
    Response.Cookies("SavedLogin").Expires = Date + 30
    bLoginSaved = True
else
    bLoginSaved = False
end if
%>

<html>
<head>

<title>山水盈盈之登录验证</title>

</head>
<body>
<% if bLoginSaved then %>
    将注册内容保存到Cookie<HR>
<% end if %>
欢迎光临随风起舞!<P>
请确认您的电子邮件: <% = Request("email") %>
</body></html>

时间: 2024-11-03 02:32:18

如何用Cookie进行登录验证?_编程10000问的相关文章

如何实现强制登录?_编程10000问

security.asp<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> <% bLoggedIn = (len(session("UserName")) > 0) if bRequireLogin then ' 要求登录.    if Not bLoggedIn then         response.redirect "l

如何用POP3接收电子邮件?_编程10000问

<%  Set pop3 = Server.CreateObject( "JMail.POP3" )   pop3.Connect "username", "password", "pop3mail.intels.net"  ' POP3的连接用户名,密码,POP3地址.   Response.Write( "你现在有" & pop3.count & " 封邮件.<br

怎样使用Cookie跟踪来访者?_编程10000问

<%Dim NumVisit' 声明变量. NumVisit = Request.Cookies("chunfeng")("totalvisit")' 检查用户来访问过多少次.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> If NumVisit = "" ThenNumVisit = 0End If'

如何用Access加密页面?_编程10000问

<%userid = Request("userid")userpass = Request("userpass") Set conn = Server.CreateObject("ADODB.Connection")DBPath = Server.MapPath("userinfo.mdb")conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=&qu

如何决定是否将登录内容保存到Cookie里?_编程10000问

login.htm<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> <% @ Language=javascript %><%if (Request.Cookies("SavedLogin").HasKeys) {    Response.Redirect("checklogin.asp?Cookie=1")}%&

网上考试设计思路是怎样的?_编程10000问

global.asa < script LANGUAGE=VBScript RUNAT=Server > Sub Application_OnStart    dbPath = "DBQ=" & Server.Mappath("onlinetest.mdb")    dbConnectionString =  "DRIVER={Microsoft Access Driver (*.mdb)}; " & dbPath  

怎样避免直接在地址栏敲入URL即可绕过登录页的错误?_编程10000问

第一个办法:用两个文件来解决这个问题:userandpwd.asp和secretarticle.asp.前者只负责提供输入用户名和密码,由后者来完成验证工作.这样即使知道了asppwdrst.asp 所在的 URL,也决不会看到什么内容的. userandpwd.asp < html > < body > < form name="form1"action= "secretarticle.asp" method_ ="POST

如何控制弹出一个NTLM验证窗口?_编程10000问

如何控制弹出一个NTLM验证窗口?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> <% Response.Status = "401 Unauthorized" Response.Addheader "WWW-Authenticate","NTLM" response.write "user=&

如何获知所有的Cookie?_编程10000问

1.撼雪喷云之显示Cookie <TABLE BORDER="2">      <Thead>            <TH>Cookie名</TH>            <TH>Cookie值</TH>            <TH>删除Cookie</TH>      </Thead><%Dim Item       %>      <tr>