【发布时间】:2014-03-02 01:06:38
【问题描述】:
我正在使用php的header函数重定向到索引页面,但是重定向后,出现了一个错误,你没有连接到网络。
两个文件都在同一个目录中。
代码是
function chklogin()
{
require('script/session.php');
if(isset($usernmae))
{
echo "welcome";
}
else
{
header('location: index.php');
}
}
header('location: index.php');
【问题讨论】:
-
我的系统上没有您的代码副本。也许发布它会很棒。
-
嗯?你能解释一下吗?仅在 index.php 上发生?
-
这里没有足够的信息。 $username 甚至在范围内吗?它甚至拼写不正确。
标签: php networking redirect header