2010-01-08 75 views
0

有人可以告訴我我錯過了什麼嗎?這個簡單的腳本無法發送會話緩存限制器,我錯過了什麼?

<? 
session_start(); 
?> 

顯示以下錯誤信息:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\test3\index.php:1) in C:\xampp\htdocs\test3\index.php on line 2 

感謝。

回答

2

它可能是由您的文本編輯器生成的字節順序標記。

2

檢查是否有前<? 任何空格,如果有session_start()之前的任何輸出 - 它不會工作

+0

+1。具體來說,檢查C:\ xampp \ htdocs \ test3 \ index.php中的第一行,如錯誤消息所示。 – 2010-01-08 03:21:19

1

session_start();應該是你的頁面上的第一件事。在任何文字或空格之前。您的網頁上應該沒有任何內容。

<?php 

    session_start(); 

    /* code here */ 

?> 
相關問題