<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/> <form id=" Form1 "Name=" Form1 "method=" Post "action=" check_remember.php "> <table width=" "border=" 1 "align=" center "cellpadding=" 0 "cellspacing=" 0 "> <thead> <tr> <td colspan=" 2 "align=" C Enter ><b> remember user name and password </b></td> </tr> </thead> <tr align= "center" > <td> username :</td> <td><input type= "text" value= "<?php echo $_cookie[' name '];? > "name=" name ></td> </tr> <tr align= "center" > <td> password:</td> <td><input t ype= "password" name= "password" value= "<?php echo $_cookie[' password ']?> ' ></td> </tr> <tr align= "center" > <td> remember username and password </td> <td><?php if ($_cookie[' remember '] = = 1) {? ><input type= "checkbox" Name= "Remember" value= "1" checked><?php}else{($_cookie[' remember '] = = "")? ><input type= " CheckBox "Name=" Remember "valuE= "1" ><?php}?></td> </tr> <tr align= "center" > <td colspan= "2" ><input type= " Submit "Name=" Submit "value="/></td> </tr> </table> </form> check_remember.php <meta http-equiv= "Content-type" content= "text/html;
Charset=utf-8 "/> <?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 "<a href=\" Remember.php\ "> Return </a>";?>