这篇文章介绍的内容是关于php 利用cookie实现网页记住用户名和密码的功能,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
1.html部分
nbsp;html> <title>记住账号密码</title> <style> </style>
2.php部分
function actionRemember() { $this->name=$_COOKIE['name']; $this->password=$_COOKIE['password']; $this->remember=$_COOKIE['remember']; $this->display("$this->subpath/remember.html"); } function actionRemtest() { $remember=$_POST['remember']; $name=$_POST['name']; $password=$_POST['password']; if($remember == '3') { setcookie("name", $name, time()+3600); setcookie('password',$password,time()+3600); setcookie('remember',$remember,time()+3600); }else{ setcookie('name','',time()-3600); setcookie('password','',time()-3600); setcookie('remember','',time()-3600); } exit; }
相关推荐:
PHP利用file_get_contents发送http请求
以上就是php 利用cookie实现网页记住用户名和密码的功能的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号