PHP cookie operation implementation code (login ). The first file is login_frm.php. the code is copied in the login window. the code is as follows: htmlheadmetahttp-equivContent-Typecontenttexthtml; charsetutf8headbodyformmeth
The first file login_frm.php. this is the logon window.
Code
The code is as follows:
The second file login. php is used to process the login
The code is as follows:
If ($ _ POST ['username'] = 'admin ')
{
Setcookie ('hahaha', 'gogogo ');
Header ("location: index. php ");
}
?>
The third file index. php looks at the effect again.
The code is as follows:
If ($ _ COOKIE ['hahaha'] = 'gogogogo ')
{
Echo $ _ COOKIE ['hahaha'];
Echo 'cookie you Set ';
}
Else
{
Echo 'You have not set cookies ';
}
?>
For more information, see PHP Cookies.
The authorization code is as follows: html head meta http-equiv = "Content-Type" content = "text/html; charset = utf8" // head body form meth...