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

Create an Account