prepare("SELECT * FROM users WHERE email = ?"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { // Password is correct, start session $_SESSION['user_id'] = $user['id']; $_SESSION['user_type'] = $user['user_type']; $_SESSION['user_name'] = $user['first_name']; // Redirect to a logged-in page (e.g., dashboard) header("Location: index.php"); exit; } else { $error = "Email o password non validi."; } } catch (PDOException $e) { $error = "Errore del database. Riprova più tardi."; // error_log($e->getMessage()); } } } ?> <?= htmlspecialchars($pageTitle) ?> - MeToo

Accedi

Bentornato! Accedi per gestire i tuoi servizi.

Non hai un account? Registrati ora