在头函数中使用PHP变量

时间:2012-10-25 14:26:05

标签: php

我正在尝试在PHP标头函数中包含一个变量,它似乎不起作用,它在地址栏中显示实际变量或只是加载一个空白屏幕。感谢您的帮助。

代码如下

header('Location: http://'.$soft_url/main'); 

3 个答案:

答案 0 :(得分:4)

该代码格式错误。

header('Location: http://'.$soft_url.'/main');

可能会解决您的问题

答案 1 :(得分:1)

试试这个:

header('Location: http://' . $soft_url . '/main'); 

答案 2 :(得分:1)

试试这个:

header("Location: http://$soft_url/main");
相关问题