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); 就会有这个错误 mysql 排序的问题~~~~~~~ 为何在cmd下执行php 文件 php exec 怎样以root用户来运行外部命令 ~~str_replace()不起作用???,求救!!~~ php菜鸟 谁能帮我看看php和Apache服务器配置的问题 请问各位:我的php打开的网页都是以西欧字符编码的,为什么? 一个简单的数据库问题在线等!!!!!!!!!! PHP中的session难题,回答给高分(100分) 为什么我所有的FORM都不能用了? php curl 模拟登录 总是提示会话过期 cookie那段该怎么写 微博的@功能的实现 类引用问题
<?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); 就会有这个错误