[請益] 重複寫入標頭錯誤
原始碼:
<?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
→
05/05 18:31, , 1F
05/05 18:31, 1F
→
05/05 23:11, , 2F
05/05 23:11, 2F
※ 編輯: TEMU2000 來自: 125.228.171.17 (05/05 23:18)