prepare("INSERT INTO users (username, email, password) VALUES (?, ?, ?)"); $stmt->execute([$username, $email, $password]); header('Location: login.php'); exit; } catch (PDOException $e) { if ($e->errorInfo[1] == 1062) { $error = 'Username or email already exists'; } else { $error = 'Something went wrong. Please try again.'; } } } ?>
Register

Already have an account? Login here.