diff --git a/login_action.php b/login_action.php index 0530f51..adb9c4e 100644 --- a/login_action.php +++ b/login_action.php @@ -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"); diff --git a/user-profile.php b/user-profile.php index b9e01b6..e7d66fb 100644 --- a/user-profile.php +++ b/user-profile.php @@ -11,6 +11,12 @@ if ($_SESSION["userId"] <> "") { $_SESSION["isLoggedIn"] = false; header("location: login.php"); } +if ($_SESSION["isVendor"] == true) { + header("location: vendor-dashboard.php"); +} + + + ?> diff --git a/vendor-dashboard.php b/vendor-dashboard.php index 4223c08..9b16140 100644 --- a/vendor-dashboard.php +++ b/vendor-dashboard.php @@ -28,6 +28,11 @@ if (is_array($vendorOrderss)) { echo "Unknown type or no 'message' property found."; } +if ($_SESSION["isCustomer"] == true) { + header("location: user-profile.php"); +} + + ?>