我是PHP的新手,我刚刚练习了PHP setcookie()并失败了。
$value = 'something from somewhere';
setcookie("TestCookie", $value);
?>
// I plan to view the cookie value via view.php
echo $_COOKIE["TestCookie"];
?>
但是我无法运行index.php,像这样的IE警告。
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\index.php:9) in C:\xampp\htdocs\test\index.php on line 12
毫无疑问,我启用了IE 6 cookie。
我上面的程序有什么问题吗?谢谢。
使用WinXP OS和XAMPP 1.7.3。