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

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

WBOY
WBOYOriginal
2016-06-13 10:48:061127browse

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

摘自 天天笑一下
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn