クッキーを利用しているブラウザで、クッキーを利用する処理を書きましたが、
Warning: Cannot modify header information - headers already sent(略)line 7というエラーが出ました。
PHP
1<?php 2if ($_COOKIE['visit']) { 3$count = $_COOKIE['visit'] + 1; 4} else { 5$count = 1; 6} 7setcookie("visit", $count); 8?> 9<html> 10<body> 11<?php print $count ;?> 12</body> 13</html>
この処理で、何か問題点があったら教えてください。
回答1件
あなたの回答
tips
プレビュー