prepare("SELECT id FROM users WHERE email = ? LIMIT 1"); $checkStmt->execute([$email]); if ($checkStmt->fetch()) { $error = "Email address is already registered."; } else { $hashed_password = password_hash($password, PASSWORD_DEFAULT); $stmt = $db->prepare("INSERT INTO users (full_name, email, password, role) VALUES (?, ?, ?, 'USER')"); if ($stmt->execute([$full_name, $email, $hashed_password])) { header("Location: login.php?msg=" . urlencode("Registration successful! Please login.")); exit; } else { $error = "Registration failed. Please try again."; } } } } ?>

Join the Elite

Create your AFG CARS account

Already have an account? Login now