php warning info
2013-11-18 23:24
162 查看
网站打开出现Warning: Cannot modify header information - headers already sent by (output started at...)
解决方法:<?php
ob_start();
setCookie("name","lastVist",time()+3600);
if(!empty($_COOKIE['lastVisit']))
{
echo "last visit".$_COOKIE['lastVisit'];
setCookie("lastVisit",date("Y-m-d H:i:s"),time()+24*3600*30);
}
else
{
echo "Welcome";
setCookie("lastVisit",date("Y-m-d H:i:s"),time()+24*3600*30);
}
?>
在php文件开头加上ob_start();就可以搞定。
相关文章推荐
- Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings.
- Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings.
- PHP Warning: date() [function.date]解决方案
- php【Warning: imageftbbox(): Could not find/open font in……】的问题
- PHP Warning: Module 'curl' already loaded in Unknown on line 0
- PHP学习 fwrite:Warning: fwrite(): supplied argument is not avalid stream resource in
- PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.
- Illegal string offset Warning PHP
- IIS使用指南之五 :深入理解Socket Pooling(套接字池)http://www.winsvr.org/info/info.php?sessid=&amp;infoid=52&amp;page=2
- ubuntu14.04 安装LAMP中访问info.php提示The requested URL /index.php was not found on this server.
- PHP Warning: Xdebug MUST be loaded as a Zend extension
- PHP 错误与异常 笔记与总结(1)错误(Deprecated,Notice,Warning)
- PHP Warning: Module 'modulename' already loaded in Unknown on line 0
- PHP Warning: date(): It is not safe to rely on the system’s timezone settings
- PHP错误:Warning: preg_replace() [function.preg-replace]: Unknown modifier '[' in
- PHP "Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0" 错误
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: Call-time pass-by-reference has been deprecated
- PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.
- mac os 安装memcache 出现 PHP Warning: PHP Startup: memcache: Unable to initialize module 解决办法