Cannot modify header information 这是什么意思,如何解决? header执行的时候前面已经有header的信息输出了,这个时候来修改有问题你可以用ob_...来做,或者放在开头 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 详细http://www.yourinspirationweb.com/en/php-tips-warning-cannot-modify-header-information-lets-get-things-straight/ Warning: Cannot modify header information 编写如下自定义函数<?php$url=127.0.0.1:8888;function message($url){ //echo "<script>window.location.href='$url';</script>"; echo "<script>alert('aa');location.href='$url';</script>";}message($url);?>证明是行不通的。我的写法有错吗?求解window.location.href和location.href调试成功的用法,并且这两个与heards的关系及区别 <?php$url='http://127.0.0.1:8888';//或者$url = "http://www.baidu.com";function message($url){ echo "<script>alert('aa');location.href='$url';</script>";}message($url);?> Warning: Cannot modify header information - (output started at index.php:1) in index.php on line 78警告:无法修改标题信息 - (输出开始的index.php:1)在index.php文件上线78很明显,你的 index.php 有 bom 头 或者多了一个空行(空格)这样 78 行的 setcookie(message, $message); 就会有这个错误 soap服务端返回二维数组,客户端无法显示 北京招聘!!!PHP编码,设计 写了一段正则用于验证email,欢迎拍砖~! eval 请高手帮忙我想把PHP动态页转成HTM页,最好有一个最简单的办法,谢谢大家 WEB服务器要配置到高的 哪里有错呢? 删除重复数据加强版(原厂) getimagesize请教 字符替换问题 微博的@功能的实现 类引用问题
<?php
$url=127.0.0.1:8888;
function message($url){
//echo "<script>window.location.href='$url';</script>";
echo "<script>alert('aa');location.href='$url';</script>";
}
message($url);
?>
证明是行不通的。我的写法有错吗?求解window.location.href和location.href调试成功的用法,并且这两个与heards的关系及区别
$url='http://127.0.0.1:8888';//或者$url = "http://www.baidu.com";
function message($url){
echo "<script>alert('aa');location.href='$url';</script>";
}
message($url);
?>
警告:无法修改标题信息 - (输出开始的index.php:1)在index.php文件上线78
很明显,你的 index.php 有 bom 头 或者多了一个空行(空格)
这样 78 行的 setcookie(message, $message); 就会有这个错误