【发布时间】:2022-11-29 14:06:45
【问题描述】:
我的代码:-
$host = "https://example.org/get.php?";
$newurl = file_get_contents($url);
$newurl = substr($newurl,stripos($newurl,"who"));
$newurl = substr($newurl,0,stripos($newurl,"</"));
// newurl string starts with "who" and ends with "</"
//var_dump($host.$newurl)."<br>"; //shows correct request string
header("Location: " . $host.$newurl);
exit();
新窗口在地址栏中显示正确的 url 请求但未重绘 除了单个“1”字符外,页面源是空白的。 在按下重新提交按钮时,页面被正确绘制。 非常感谢任何帮助。
史蒂夫
【问题讨论】:
-
file_get_contents($url)中的$url变量没有定义? -
如果您在
header之前输出一些内容,那么您会使标头无效