简体   繁体   English

PHP中的重定向语法问题

[英]Redirect syntax issue in PHP

I am trying to redirect a php page. 我正在尝试重定向php页面。 the following is my php script : 以下是我的php脚本:

    $url=$_SERVER['HTTP_HOST'];
    header("Location: $url/suppliers");

But the php page throws error saying invalid redirect error. 但是php页面抛出错误,指出无效的重定向错误。 i am not understanding what the problem is. 我不明白问题是什么。 Can anyone help me on this? 谁可以帮我这个事?

try like this: 尝试这样:

header("Location: http://" . $_SERVER['HTTP_HOST'] . "/suppliers");
exit();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM