作者claire0810 (Claire)
看板PHP
標題[請益] 關於 自動轉址 header("location:XXX.php");
時間Fri Aug 14 17:13:26 2009
我寫了一個有關於儲存資料的網頁
網頁1是列印資料庫裡的資料
下面有一個新增資料的功能
點選下去會跳到網頁2內容是有關於新增資料的欄位那些
點選儲存 會跳到網頁3 網頁三就是單純的一些寫入資料庫的程式碼
此時 我想要再網頁3 加一個自動轉址到網頁1
我加在mysql_close($link);
可是卻不會自動轉址
並出現下列的錯誤訊息
Warning: Cannot modify header information - headers already sent by (output
started at C:\AppServ\www\project\calenderOK\day_data4.php:9) in
C:\AppServ\www\project\calenderOK\day_data4.php on line 142
我有嚐試過 把header("location:XXX.php");
改成header("location:
http://tw.yahoo.com");
但是依然出現相同的錯誤訊息
請問我該如何解決呢!!?
請各位教教我
※ 編輯: claire0810 來自: 61.220.30.237 (08/14 17:14)
推 wannawanna :請把它放在輸出之前 08/14 17:19
推 appleboy46 :header 前面不能輸出任何 html 包括空白 08/14 17:34
推 arrack :open output_buffer 08/14 17:49
推 liaosankai :應該又是那該死的BOM的問題吧XD 08/15 06:46
推 maplenote :若確定沒輸出 請新增新網頁 程式碼貼去記事本 再貼回 08/15 09:30
→ maplenote :可能是多了其他編碼的字元 造成有看不到的輸出 08/15 09:33
→ claire0810 :感謝 問題已經順利解決!!! 08/15 10:00