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

php使用cookie实现记住用户名和密码实现代码_PHP

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



 
check_remember.php

<?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 "返回";
?>

人气教程排行