From a6d66a5253f18a47f95cc337b9f3489a5e81081a Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 8 Apr 2026 10:56:58 +0200 Subject: [PATCH] Aggiunta cognome in sessione --- account.php | 6 +++--- cart.php | 4 ++-- index.php | 4 ++-- login.php | 7 ++++--- product.php | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/account.php b/account.php index ee0fad8..39c4bea 100644 --- a/account.php +++ b/account.php @@ -25,16 +25,16 @@ if ($result === false) {
- + - Benvenuto, + Benvenuto,
- +
    diff --git a/cart.php b/cart.php index eb6fd1d..4810016 100644 --- a/cart.php +++ b/cart.php @@ -16,9 +16,9 @@ session_start();
    - + - Benvenuto, + Benvenuto, diff --git a/index.php b/index.php index b6c7007..c44cc25 100644 --- a/index.php +++ b/index.php @@ -25,9 +25,9 @@ if ($result === false) {
    - + - Benvenuto, + Benvenuto, diff --git a/login.php b/login.php index c6e7a10..61b34e2 100644 --- a/login.php +++ b/login.php @@ -17,19 +17,20 @@ $email = $_POST['email']; $password = $_POST['password']; - $sql = "SELECT UserID, Name, Password, Role FROM Users WHERE Email = ?"; + $sql = "SELECT UserID, Name, Surname, Password, Role FROM Users WHERE Email = ?"; if ($stmt = $conn->prepare($sql)) { $stmt->bind_param("s", $email); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { - $stmt->bind_result($user_id, $name, $hashed_password, $role); + $stmt->bind_result($user_id, $name, $surname, $hashed_password, $role); $stmt->fetch(); if (password_verify($password, $hashed_password)) { $_SESSION['id'] = $user_id; - $_SESSION['user'] = $name; + $_SESSION['name'] = $name; + $_SESSION['surname'] = $surname; $_SESSION['role'] = $role; header('Location: index.php'); exit(); diff --git a/product.php b/product.php index 7205975..6d4d764 100644 --- a/product.php +++ b/product.php @@ -36,9 +36,9 @@ if ($stmt = $conn->prepare($sql)) {
    - + - Benvenuto, + Benvenuto,