Cannot modify header information出错的原因
发布时间:2020-12-13 20:30:12 所属栏目:PHP教程 来源:网络整理
导读:?php ob_start(); setcookie(username,宋岩宾,time()+3600); echo the username is:.$HTTP_COOKIE_VARS[username].; echo the username is:.$_COOKIE[username].; print_r($_COOKIE); ? Warning: Cannot modify header information - headers already sent by
<?php ob_start(); setcookie("username","宋岩宾",time()+3600); echo "the username is:".$HTTP_COOKIE_VARS["username"].""; echo "the username is:".$_COOKIE["username"].""; print_r($_COOKIE); ?> Warning: Cannot modify header information - headers already sent by出错的原因 我在php程序的头部加了, header("cache-control:no-cache,must-revalidate"); 之后页面就出现上面的错误,看了N个资料也没有结果。今天偶尔发现原来是我的php.ini里面的配置出了问题,在C:windows下找到php.ini文件 output_buffering默认为off的。我现在把它设为4096就OK了。 用于解决显示提示错误,不能按(日期+导出文件数)为文件名的错误信息. setcookie函数必 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |