up to dated
This commit is contained in:
parent
7b84a1fc13
commit
2e98c61f0c
12
register.php
12
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user