Cookie Usage _php Tutorial

Source: Internet
Author: User
cookie Usage Let's take a look at the PHP cookie usage today and give a simple example to illustrate. Cookies I don't want to say that most will understand that it just saved a cookie file on the client, read it in a browser, Well, the rest is not much to say. Want to know more please go to www.111cn.cn to find it.

$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: The original site reproduced please specify www.111cn.cn

http://www.bkjia.com/PHPjc/631374.html www.bkjia.com true http://www.bkjia.com/PHPjc/631374.html techarticle cookie Usage Let's take a look at PHP cookie usage today and give a simple example to illustrate. Cookies I would not say that most will understand that it just saved a cookie file on the client ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.