blocked shopping.php for non-logged in user
This commit is contained in:
parent
8f34787d50
commit
e3a9def0db
@ -25,7 +25,6 @@ $result = query_username($conn, $userName);
|
|||||||
|
|
||||||
if ($result->num_rows > 0) {
|
if ($result->num_rows > 0) {
|
||||||
$row = $result->fetch_assoc();
|
$row = $result->fetch_assoc();
|
||||||
$_SESSION['username'] = $userName;
|
|
||||||
|
|
||||||
$passWord_hashed = $row["C_Password"];
|
$passWord_hashed = $row["C_Password"];
|
||||||
$passWord_correct = password_verify($passWord_user, $passWord_hashed);
|
$passWord_correct = password_verify($passWord_user, $passWord_hashed);
|
||||||
@ -45,6 +44,7 @@ if ($result->num_rows > 0) {
|
|||||||
|
|
||||||
// if($response->success){
|
// if($response->success){
|
||||||
// echo "Verification success.";
|
// echo "Verification success.";
|
||||||
|
// $_SESSION['username'] = $userName;
|
||||||
// header("Location: shopping.php");
|
// header("Location: shopping.php");
|
||||||
// } else {
|
// } else {
|
||||||
// echo "<script> alert('reCAPTHCA verification failed, please try again.');location.href='login.php'; </script>";
|
// echo "<script> alert('reCAPTHCA verification failed, please try again.');location.href='login.php'; </script>";
|
||||||
@ -58,6 +58,7 @@ if ($result->num_rows > 0) {
|
|||||||
|
|
||||||
// TODO: delete later
|
// TODO: delete later
|
||||||
echo "Verification success.";
|
echo "Verification success.";
|
||||||
|
$_SESSION['username'] = $userName;
|
||||||
header("Location: ../shopping/shopping.php");
|
header("Location: ../shopping/shopping.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,10 @@
|
|||||||
require_once '../php/connection.php';
|
require_once '../php/connection.php';
|
||||||
$conn = connectMysql();
|
$conn = connectMysql();
|
||||||
session_start();
|
session_start();
|
||||||
|
if(!isset($_SESSION['username'])) {
|
||||||
|
header('Location: ../index.html');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<head>
|
<head>
|
||||||
<!-- Required meta tags -->
|
<!-- Required meta tags -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user