ASP实现记住密码的功能asp

/ / 2016-06-05   阅读:2493
把以下代码加入验证页:   <%if Trim(Cstr(request.QueryString("check")))="true" then ‘用来判断是否有选择记住密码   Response.Cookies("UserCookie")("username") = Trim(Cstr(request.Form("us...
把以下代码加入验证页:  
<%if Trim(Cstr(request.QueryString("check")))="true" then ‘用来判断是否有选择记住密码  
Response.Cookies("UserCookie")("username") = Trim(Cstr(request.Form("username")))  
Response.Cookies("UserCookie")("passwords") = trim(request.Form("passwords"))  
Response.Cookies("UserCookie").Path = "/login.asp"  
Response.Cookies("UserCookie").Expires= DateAdd("y",1,Now())  
end if%> 

登录页代码:  
//这段代码是用来判断是否有选择记住密码,同时也发送一个判断字段给后台  
<script type="text/JavaScript">  
function check()  
{if(document.getElementById("checkbox").checked)  
alert(document.getElementById("checkbox").checked)  
document.getElementById("ddd").action=’check.asp?id=user&check=’+document.getElementById("checkbox").checked;}  
</script> 

以下代码是用来实现记住密码的功能  
<%  
strUsername=Request.Cookies("UserCookie")("username")  
strPassword=Request.Cookies("UserCookie")("passwords")  
%>

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈