Cookie operation instance in php. In php, the cookie operation instance performs a cookie operation. The first file login_frm.PHP is the logon window. Code 1234561011: the second file login. php is used to process the cookie operation instance for logging on to php.
The first file login_frm.PHP is the logon window.
Code 1
2
3
4
5
6
10
11
The second file login. php is used to process the login
1
2 if ($ _ POST ['username'] = 'admin ')
3 {
4 setcookie ('haha', 'gogogo ');
5 header ("location: index. php ");
6}
7?>
The third file index. php looks at the effect again.
1
2 if ($ _ COOKIE ['hahaha'] = 'gogogogo ')
3 {
4
5 echo $ _ COOKIE ['hahaha'];
6 echo 'cookie set ';
7}
8 else
9 {
10 echo 'You have not set cookies ';
11}
12?>
The worker performs a cookie operation on the instance. The first file login_frm.PHP is the logon window. Code 1 2 3 4 5 6 10 11 second file login. php this is processing login...