当前位置:Gxlcms > PHP教程 > php记住用户名和密码实现代码(cookie)_PHP教程

php记住用户名和密码实现代码(cookie)_PHP教程

时间:2021-07-01 10:21:17 帮助过:33人阅读

remember.php



check_remember.php

$name = $_POST['name'];
$password = $_POST['password'];
$remember = $_POST['remember'];
if($remember == 1){
setcookie('name',$name,time()+3600);
setcookie('password',$password,time()+3600);
setcookie('remember',$remember,time()+3600);
}else{
setcookie('name',$name,time()-3600);
setcookie('password',$password,time()-3600);
setcookie('remember',$remember,time()-3600);
}
echo "返回";
?>

摘自 天天笑一下

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478333.htmlTechArticleremember.php meta http-equiv=Content-Type content=text/html; charset=utf-8 / form id=form1 name=form1 method=post action=check_remember.php table width=300 border=1 align=center cel...

人气教程排行