ログイン情報を送信した後、Web サイトを前のページにリダイレクトしたいと考えています。
- 私はこの問題を探し回った
- $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");
}
}
?>