prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute([$email]); if ($stmt->fetch()) { $error = "Un account con questa email esiste già."; } else { // Hash the password $hashed_password = password_hash($password, PASSWORD_DEFAULT); // Insert the new user $insert_stmt = $pdo->prepare( "INSERT INTO users (first_name, last_name, email, password, user_type) VALUES (?, ?, ?, ?, 'customer')" ); if ($insert_stmt->execute([$first_name, $last_name, $email, $hashed_password])) { $success = "Registrazione completata! Ora puoi effettuare il login."; } else { $error = "Si è verificato un errore durante la registrazione. Riprova."; } } } catch (PDOException $e) { // In a real app, you would log this error. $error = "Errore del database. Riprova più tardi."; // error_log($e->getMessage()); } } } ?> <?= htmlspecialchars($pageTitle) ?> - MeToo

Registrati come Cliente

Crea un account per trovare e prenotare servizi in modo facile e veloce.

Sei un fornitore? Registrati qui.

Hai già un account? Accedi.