From 2e98c61f0c3c60126991dcc92ce9decbf0cb214a Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 17 Oct 2025 11:14:50 +0000 Subject: [PATCH] up to dated --- register.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/register.php b/register.php index 39447b9..f077b33 100644 --- a/register.php +++ b/register.php @@ -39,8 +39,6 @@ $first_name = filter_input(INPUT_POST, 'first_name', FILTER_SANITIZE_STRING); $last_name = filter_input(INPUT_POST, 'last_name', FILTER_SANITIZE_STRING); $company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_STRING); $how_did_you_hear = filter_input(INPUT_POST, 'how_did_you_hear', FILTER_SANITIZE_STRING); -$password = $_POST['password'] ?? null; // Not sanitizing for comparison -$confirm_password = $_POST['confirm_password'] ?? null; $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); // --- VALIDATION --- @@ -48,13 +46,6 @@ if (!$first_name || !$last_name || !$email) { echo json_encode(['success' => false, 'error' => 'Please fill out all required fields.']); exit; } -// Password validation can be added here if needed, e.g., length -// For now, just checking if they match if provided -if (isset($password) && $password !== $confirm_password) { - echo json_encode(['success' => false, 'error' => 'Passwords do not match.']); - exit; -} - try { // --- CHECK IF ALREADY REGISTERED --- @@ -66,7 +57,8 @@ try { } // --- REGISTER USER --- - $password_hash = isset($password) ? password_hash($password, PASSWORD_DEFAULT) : null; + // Generate a password hash from the email as we don't have a password field + $password_hash = password_hash($email . time(), PASSWORD_DEFAULT); $sql = "INSERT INTO attendees (webinar_id, first_name, last_name, email, company, how_did_you_hear, password, timezone) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = db()->prepare($sql);