Home >php教程 >php手册 >cookie用法

cookie用法

WBOY
WBOYOriginal
2016-06-13 10:03:071017browse

 cookie用法   今天我们再来看看php cookie用法并会举一个简单的例子来说明.cookie我想不说大多都会明白了,它只是在客户端保存了一个cookie文件,用浏览器去读的,好了其它的就不多说了想知道更多请到www.111cn.cn 去找吧.

$value =$_SERVER['HTTP_HOST'];
 echo $value;
 if(empty($_COOKIE["cook"])){
  setcookie("cook", $value, time()+1800, "/");
  if(sizeof($_POST)   for($i=1;$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';
 }

注明:本站原转载请注明www.111cn.cn

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn