标头重定向不起作用

时间:2014-06-28 16:48:48

标签: php

在开始时我告诉你之前在stackoverflow上询问它但是没有一个对我有用。我有一个简单的php程序程序,它在php中使用header()命令重定向页面。但是当我运行脚本时,我得到error header already sent at line:(line_no)。我已经阅读了很多关于stackoverflow的问题并尝试解决方案,但我仍然得到错误。这是我的php

<?php
header("location:index.php");
include("top.php");
$product_id=$_GET['product_id'];
?>

我不知道它为什么会来,我也没有回应任何文字或其他东西,我也没有在开始时留下空格。但我仍然得到错误标题

Warning: Cannot modify header information - headers already sent by (output started at E:\wordpress\InstantWP_4.3.1\iwpserver\htdocs\test.php:1) in E:\wordpress\InstantWP_4.3.1\iwpserver\htdocs\test.php on line 1

The error is coming at line when where i have started the <?php 也许你可以告诉我什么原因以及如何解决它。提前致谢

0 个答案:

没有答案