【发布时间】:2015-02-21 11:50:49
【问题描述】:
我检查了不同页面中的所有答案并使用它,但错误仍然出现。请帮帮我。
错误是:
Warning: Cannot modify header information - headers already sent by (output started at /home/iraustor/public_html/copytest/post.php:1) in /home/iraustor/public_html/copytest/post.php on line 57
表单的网址在这里:http://iraust.org/copytest/contact.html
完成表格后的页面是:http://www.iraust.org/copytest/thanks.html(或任何其他隐藏此消息的方法)
花了 2 天的时间,但得到了答复。请帮帮我。
"header("Location:$Redirect_Page");"
【问题讨论】:
-
确保在 php 开始和结束标记之外没有空格。 虽然
<?php开始标记之前的空行在 PHP 处理时可能看起来很无辜,它会变成一个回显语句,打印出一个空行。这是一个常见的罪魁祸首。 -
另外,您不希望在关闭 php 标签后出现空行 (
?>)。更好的办法是简单地离开那些结束标签。它们只会引起问题,跳过它们是安全的。 -
检查过了。标签前没有空格,尤其是第一个
-
错误表明输出是在
post.php(post.php:1) 的1行开始的......如果在打开<?php之前没有任何内容,则检查文件没有 BOM 表头
标签: php redirect header location contact