diff --git a/index.php b/index.php
index af02b1d..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 ba7807f..61b34e2 100644
--- a/login.php
+++ b/login.php
@@ -17,18 +17,21 @@
$email = $_POST['email'];
$password = $_POST['password'];
- $sql = "SELECT Name, Password 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($name, $hashed_password);
+ $stmt->bind_result($user_id, $name, $surname, $hashed_password, $role);
$stmt->fetch();
if (password_verify($password, $hashed_password)) {
- $_SESSION['user'] = $name;
+ $_SESSION['id'] = $user_id;
+ $_SESSION['name'] = $name;
+ $_SESSION['surname'] = $surname;
+ $_SESSION['role'] = $role;
header('Location: index.php');
exit();
} else {
diff --git a/product.php b/product.php
index 80675ba..6d4d764 100644
--- a/product.php
+++ b/product.php
@@ -36,9 +36,9 @@ if ($stmt = $conn->prepare($sql)) {
