关于php中session_start()的问题

来源:百度知道 编辑:UC知道 时间:2024/07/02 01:04:50
在运行计数器的时候出现这样的错误
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\zhizuo\index.php:7) in C:\AppServ\www\zhizuo\count.php on line 3
该错误在我的主页调用时出现,在独自页面使用时没错误!!

session_start();
使用之前浏览器不能有输出
或者说不能打印任何东西到浏览器

session_start、header、setcookie
这类语句必须出现在内容输出的前面(就是在网页开头),也就是说必须放在所有echo和不在<? ?>里面内容的前面

你这样,就用iframe吧

这东西必须在输出任何内容之前发出,所以建议养成写在PHP程序第首行来写这些东西

session_start()把这个放到代码的顶上