加入收藏 | 设为首页 | 会员中心 | 我要投稿 大同站长网 (https://www.0352zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

如何用Cookie进行登录验证?

发布时间:2016-11-29 17:21:00 所属栏目:MySql教程 来源:站长网
导读:login.htm 请注册登录随风起舞 lt;FORM ACTION="checklogin.asp" METHOD="POST"gt; nbsp; nbsp; 电子邮件: lt;input TYPE="Text" NAME="email" SIZE="40"gt; nbsp; nbsp; 密码: lt;input TYPE="Password" NAME="Password" SIZE="40"gt; nbsp; nbsp; lt;inp

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

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

lt;htmlgt;
lt;headgt;

lt;titlegt;山水盈盈之登录验证lt;/titlegt;

lt;/headgt;
lt;bodygt;
lt;% if bLoginSaved then %gt;
nbsp; nbsp; 将注册内容保存到Cookielt;HRgt;
lt;% end if %gt;
欢迎光临随风起舞!lt;Pgt;
请确认您的电子邮件: lt;% = Request("email") %gt;
lt;/bodygt;lt;/htmlgt;

(编辑:大同站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读