prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute([$email]); if ($stmt->fetch()) { $errors[] = 'Email already exists.'; } else { $hashed_password = password_hash($password, PASSWORD_DEFAULT); $stmt = $pdo->prepare("INSERT INTO users (email, password) VALUES (?, ?)"); $stmt->execute([$email, $hashed_password]); $success = 'Registration successful! You can now log in.'; } } catch (PDOException $e) { $errors[] = 'Database error: ' . $e->getMessage(); } } } ?>

Register

Already have an account? Login here.