Error handling for user-profile and vendor-settings

This commit is contained in:
jouls 2024-04-16 13:47:04 +08:00
parent d27f546bba
commit d24c4f98d2
3 changed files with 13 additions and 1 deletions

View File

@ -19,7 +19,7 @@
if ($result > 0) {
$_SESSION["isVendor"] = true;
}
header("location: index.php");
header("location: $url");
} else {
// $_SESSION["loginError"] = "Invalid email or password. Please try again.";
header("location: login.php?error=1");

View File

@ -11,6 +11,12 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-settings.php");
}
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -21,6 +21,12 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">