正如標(biāo)題所示,我正在嘗試使用相同的 .php 頁面,并讓它在從特定位置重定向時(shí)顯示新的內(nèi)容。在上下文中...我有一個(gè)登錄,成功登錄后重定向到主頁,但如果不成功,則重定向到索引。有沒有辦法讓我的索引頁面在從登錄頁面重定向時(shí)顯示“登錄錯(cuò)誤”消息?這是我的登錄代碼...<?phpsession_start();include('conn.php');$query = "SELECT * FROM User";$result = mysqli_query($conn, $query) or die(mysqli_error($conn));if (isset($_POST["submit"])) { $logEmail = $conn->real_escape_string($_POST['logEmail']); $logPass = $conn->real_escape_string($_POST['logPass']); $checkuser = "SELECT * FROM User WHERE Email='$logEmail' AND UserPassword=AES_ENCRYPT('$logPass', 'MyKey')"; $userresult = mysqli_query($conn, $checkuser) or die(mysqli_error($conn)); $loginsucc = (mysqli_num_rows($userresult) > 0); if (mysqli_num_rows($userresult) > 0) { while ($row = mysqli_fetch_assoc($userresult)) { $userPriKey = $row['UserID']; $userid = $row['Email']; $accounttype = $row['IsAdmin']; $firstname = $row['FirstName']; $surname = $row['LastName']; $_SESSION['userPriKey'] = $userPriKey; $_SESSION['name'] = $firstname; $_SESSION['surname'] = $surname; $_SESSION['Email'] = $userid; $_SESSION['IsAdmin'] = $accounttype; if($accounttype == '1'){ header("Location: home.php"); }else if ($accounttype == '0'||$accounttype == NULL ) { header("Location: userhome.php"); } } } else { header("Location: index.php"); }}?>
從特定頁面重定向后更改文本...?
月關(guān)寶盒
2023-11-13 14:41:06