Php 成功登录后如何重定向到所需页面?
我已成功发送过期事件的警报电子邮件。从电子邮件中有一个链接,使用户可以链接回特定事件的详细信息。如果用户尚未登录,它将重定向到登录页面。一旦登录成功,它将返回主页。如何在登录后重定向到特定事件页面Php 成功登录后如何重定向到所需页面?,php,redirect,login,Php,Redirect,Login,我已成功发送过期事件的警报电子邮件。从电子邮件中有一个链接,使用户可以链接回特定事件的详细信息。如果用户尚未登录,它将重定向到登录页面。一旦登录成功,它将返回主页。如何在登录后重定向到特定事件页面 $contractid = $_REQUEST['Contract_ID']; $contract_update_url = "contract_updates.php?id=".$contractid; $MM_redirectLoginSuccess = "news_mgm.php";
$contractid = $_REQUEST['Contract_ID'];
$contract_update_url = "contract_updates.php?id=".$contractid;
$MM_redirectLoginSuccess = "news_mgm.php";
if (isset($_SESSION['MM_Username'])){
header("Location: " . $MM_redirectLoginSuccess );}
if(!empty ($contactid))
{
header("Location: " . $contract_update_url );
}
else{
// header("Location: " . $MM_redirectLoginSuccess );
header("Location: javascript://history.go(-1)");
}
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
首先,您必须将有关事件的信息(例如,事件ID)传递到电子邮件上的链接 然后,您可以在处理用户登录时保留此事件ID,如果可以,请按事件ID重定向到事件页面