我想让我的网站在提交登录信息后重定向到上一页。
- 我已经四处寻找这个问题
- 我已经回应了 $url 的内容,甚至做了 strcmp 并且它评估为 true(此处未显示)
- 问题:即使 $url == mlbmain.php OR course-website.php,ELSE 语句也总是会计算
有什么建议么?
<?PHP
require_once("./include/membersite_config.php");
echo "</br> </br> </br> </br>";
$url = isset($_GET['return_url']) ? $_GET['return_url'] : 'login.php';
//url now == to /mlbmain.php OR /course-website.php
$url = substr($url,1);
//url now == to mlbmain.php OR course-website.php
echo $url; //Just to make sure
$url = trim($url); //trim it to make sure no whitespaces
echo "</br>";
echo $url; //Just to make sure it's still the same
if(isset($_POST['submitted']))
{
if($fgmembersite->Login())
{
if($url == "mlbmain.php"){
$fgmembersite->RedirectToURL("mlbmain.php");
}
else if($url == "course-website.php"){
$fgmembersite->RedirectToURL("course-website.php");
}
else
$fgmembersite->RedirectToURL("index.php");
}
}
?>