Cookie usage. Cookie usage today, let's take a look at phpcookie usage and give a simple example to illustrate it. I don't want to say that most of them will understand it. it just saves a cookie file on the client.
Cookie usage today let's take a look at php cookie usage and give a simple example to illustrate. I don't know much about cookies. it only saves a cookie file on the client and reads it using a browser, well, I won't say much about others. please go to www.111cn.cn for more information.
$ Value = $ _ SERVER ['http _ host'];
Echo $ value;
If (empty ($ _ COOKIE ["cook"]) {
Setcookie ("cook", $ value, time () + 1800 ,"/");
If (sizeof ($ _ POST) <8) {echo 'BB ';}
For ($ I = 1; $ I <= 8; $ I ++ ){
$ C = $ _ POST ['R'. $ I];
Switch (intval ($ c )){
Case 0:
$ Word = 'vote _ r1 ';
Break;
Case 1:
$ Word = 'vote _ R2 ';
Break;
Case 2:
$ Word = 'vote _ r3 ';
Break;
Default:
Exit ('error ');
}
$ SQL = "update gx_votes set $ word = $ word + 1 where id = $ I ";
Mysql_query ($ SQL) or die (mysql_error ());
}
Echo 'OS ';
} Else {
Print '00 ';
}
Note: Please indicate www.111cn.cn for original reprinted on this site
Today, let's take a look at the usage of php cookies and give a simple example to illustrate them. I don't want to say much about cookies. it only saves a cookie file on the client...