看板 PHP 關於我們 聯絡資訊
原始碼: <?php ob_start(); setcookie("test","test"); ob_end_flush(); ?> <html> </html> 執行結果: Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\fhsh\test.php:1) in D:\AppServ\www\fhsh\test.php on line 3 環境是app-serv 2.5.10 我把setcookie放在<html>標籤前面仍然會發生重複寫入標頭錯誤 即使使用ob_start()函式開啟緩衝區也沒有作用 請問為何會發生這種問題呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.228.171.17
arrack:bom 05/05 18:31
TEMU2000:感謝1F解答,查了一下資料才知道原因@@ 05/05 23:11
※ 編輯: TEMU2000 來自: 125.228.171.17 (05/05 23:18)