This commit is contained in:
Flatlogic Bot 2025-10-17 09:53:55 +00:00
parent d762bc8263
commit b9f0c9ea5a

View File

@ -10,8 +10,8 @@ $response = [];
$webinar = null; $webinar = null;
if ($webinar_id) { if ($webinar_id) {
try { try {
// Fetch webinar details to create calendar links $stmt = $pdo->prepare("SELECT title, description, starts_at, ends_at FROM webinars WHERE id = ?");
$stmt = $pdo->query("SELECT title, description, starts_at, ends_at FROM webinars ORDER BY starts_at ASC LIMIT 1"); $stmt->execute([$webinar_id]);
$webinar = $stmt->fetch(PDO::FETCH_ASSOC); $webinar = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) { } catch (PDOException $e) {
// Log error, but don't show to user // Log error, but don't show to user
@ -21,9 +21,22 @@ if ($webinar_id) {
// --- FORM SUBMISSION (POST REQUEST) --- // --- FORM SUBMISSION (POST REQUEST) ---
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
header('Content-Type: application/json'); header('Content-Type: application/json');
// --- DATA CAPTURE --- // --- DATA CAPTURE ---
$webinar_id = filter_input(INPUT_POST, 'webinar_id', FILTER_VALIDATE_INT); $webinar_id = filter_input(INPUT_POST, 'webinar_id', FILTER_VALIDATE_INT);
// --- WEBINAR DETAILS ---
$webinar = null;
if ($webinar_id) {
try {
// Fetch webinar details to create calendar links
$stmt = $pdo->prepare("SELECT title, description, starts_at, ends_at FROM webinars WHERE id = ?");
$stmt->execute([$webinar_id]);
$webinar = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
// Log error, but don't show to user
}
}
$email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$first_name = filter_input(INPUT_POST, 'first_name', FILTER_SANITIZE_STRING); $first_name = filter_input(INPUT_POST, 'first_name', FILTER_SANITIZE_STRING);
$last_name = filter_input(INPUT_POST, 'last_name', FILTER_SANITIZE_STRING); $last_name = filter_input(INPUT_POST, 'last_name', FILTER_SANITIZE_STRING);
@ -178,8 +191,20 @@ if (!$webinar) {
<p class="microcopy">Well send the join link & calendar invite.</p> <p class="microcopy">Well send the join link & calendar invite.</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="first_name">First name (optional)</label> <label for="first_name">First name</label>
<input type="text" id="first_name" name="first_name"> <input type="text" id="first_name" name="first_name" required>
</div>
<div class="form-group">
<label for="last_name">Last name</label>
<input type="text" id="last_name" name="last_name" required>
</div>
<div class="form-group">
<label for="company">Company</label>
<input type="text" id="company" name="company">
</div>
<div class="form-group">
<label for="how_did_you_hear">How did you hear about this webinar?</label>
<input type="text" id="how_did_you_hear" name="how_did_you_hear">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">Password</label> <label for="password">Password</label>