Home  >  Article  >  Backend Development  >  一个简单的cookie求教解决方案

一个简单的cookie求教解决方案

WBOY
WBOYOriginal
2016-06-13 13:36:13756browse

一个简单的cookie求教

PHP code




=$i?>





请教 如何在第一次点击的时候 就获取正确的cookie的值
这个程序要点两次才可以获得正确的 第一次点击 是记录上一次点击的值
求教求教

------解决方案--------------------
$name=$_GET["name"];
$value=$_GET["value"];
setcookie($name,$value);

$_COOKIE[$name] = $value;
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