看板 PHP 關於我們 聯絡資訊
對於 php 我還算個新手,所以想請問一下各位大大 我想利用一組亂數來當做使用者的ID 下以,是我的程式碼 if (!isset($id)) { srand((double)microtime()*1000000); $id = rand(); setcookie("id",$id,time()+14400,"/",".domain.name",0); } 不過,這樣設置,都會在 setcookie那邊出現編碼錯誤 Warning: Cannot modify header information - headers already sent by (output started at /home/test/public_html/index.php:6) in /home/test/public_html/index.php on line 20 換了一些方式 ,總是會在setcookie那邊出錯 真的很傷腦筋............ㄒ又ㄒ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.74.205.37