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, location) VALUES (?, ?, ?, ?, 'provider', ?)" ); if ($insert_stmt->execute([$first_name, $last_name, $email, $hashed_password, $location])) { $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 Fornitore

Crea il tuo account per offrire i tuoi servizi sulla nostra piattaforma.

Sei un cliente? Registrati qui.

Hai già un account? Accedi.