PHP 重定向不显示重定向到的页面的内容

  • 本文关键字:重定向 显示 PHP php redirect
  • 更新时间 :
  • 英文 :


Page1.php 代码;

...
header('Location: editt.php?msg=landing&msisdn='.$msisdn);
...

第2页.php代码;

$msisdn = $_GET['msisdn'];
$msg = $_GET['msg'];
echo 'Page 2 Content '.$msisdn;

你发布的这段代码有效,也许在你的其余代码中header( )之前有一些html输出,如果有一些的话,这也可以在一些包含的文件中。

更新:

关于同一问题的一些有用答案可以在这里找到:

php-header-redirect-not-work

为什么不使用标头作为数据的容器:

header('msg: msgValue');
header('msisdn: msisdnValue');
header('Location: editt.php');

正在编辑中.php

$headers = apache_request_headers();
foreach ($headers as $header => $value) {
    echo "$header: $value <br />n";
}

最新更新