debugging rsvp-submit.php

This commit is contained in:
spetznas committed 2026-06-17 19:16:12 +02:00
1 parent 891ffce73e
commit 2f1de8f764
11 files changed
+61 -59

No files matched your search

+2 -2
View File
@@ -137,14 +137,14 @@
<li class="navigation-item">
<a href="/ru/categories/">🇷🇺</a>
<a href="/de/categories/">🇩🇪</a>
</li>
<li class="navigation-item">
<a href="/de/categories/">🇩🇪</a>
<a href="/ru/categories/">🇷🇺</a>
</li>
+2 -2
View File
@@ -136,14 +136,14 @@
<li class="navigation-item">
<a href="/ru/404.html">🇷🇺</a>
<a href="/404.html">🇬🇧</a>
</li>
<li class="navigation-item">
<a href="/404.html">🇬🇧</a>
<a href="/ru/404.html">🇷🇺</a>
</li>
+5 -5
View File
@@ -20,6 +20,11 @@
/>
</url><url>
<loc>http://markinstefan.xyz/de/categories/</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
@@ -30,11 +35,6 @@
hreflang="ru"
href="http://markinstefan.xyz/ru/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
</url><url>
<loc>http://markinstefan.xyz/de/hochzeit/</loc>
<xhtml:link
+10 -10
View File
@@ -20,6 +20,11 @@
/>
</url><url>
<loc>http://markinstefan.xyz/categories/</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
@@ -30,11 +35,6 @@
hreflang="ru"
href="http://markinstefan.xyz/ru/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
</url><url>
<loc>http://markinstefan.xyz/contact/</loc>
<xhtml:link
@@ -139,11 +139,6 @@
/>
</url><url>
<loc>http://markinstefan.xyz/tags/</loc>
<xhtml:link
rel="alternate"
hreflang="ru"
href="http://markinstefan.xyz/ru/tags/"
/>
<xhtml:link
rel="alternate"
hreflang="de"
@@ -154,5 +149,10 @@
hreflang="en"
href="http://markinstefan.xyz/tags/"
/>
<xhtml:link
rel="alternate"
hreflang="ru"
href="http://markinstefan.xyz/ru/tags/"
/>
</url>
</urlset>
+8 -7
View File
@@ -1,6 +1,5 @@
<?php
require __DIR__ . '/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
@@ -10,7 +9,6 @@ use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->safeLoad();
function checkboxArrayToString($value)
{
if (is_array($value) && count($value) > 0) {
@@ -39,8 +37,8 @@ $first_name = trim($_POST['first_name'] ?? '');
$last_name = trim($_POST['last_name'] ?? '');
$name = trim("$first_name $last_name");
$email = trim($_POST['email'] ?? '');
$phone = trim($_POST['phone'] ?? '');
$email = trim($_POST['email'] ?? '');
$phone = trim($_POST['phone'] ?? '');
// Attendance
$attendance = $_POST['attendance'] ?? 'Unknown';
@@ -107,12 +105,13 @@ try {
$mail->CharSet = 'UTF-8';
$mail->isSMTP();
$mail->Host = gethostbyname($_ENV['SMTP_HOST']);
$mail->Host = $_ENV['SMTP_HOST'];
$mail->SMTPAuth = true;
$mail->Username = $_ENV['SMTP_USER'];
$mail->Password = $_ENV['SMTP_PASS'];
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = (int)$_ENV['SMTP_PORT'];
$mail->Timeout = 10;
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
$mail->addAddress($_ENV['TO_EMAIL']);
@@ -196,7 +195,6 @@ EOD;
$mail->Body = $body;
$mail->Timeout = 10;
$mail->send();
header('Location: /thank-you/');
@@ -204,5 +202,8 @@ $mail->Timeout = 10;
} catch (Exception $e) {
echo "RSVP could not be sent. Mailer Error: {$mail->ErrorInfo}";
error_log('RSVP mail error: ' . $mail->ErrorInfo);
http_response_code(500);
echo 'An error occurred while sending the RSVP.';
}
+2 -2
View File
@@ -137,14 +137,14 @@
<li class="navigation-item">
<a href="/categories/">🇬🇧</a>
<a href="/de/categories/">🇩🇪</a>
</li>
<li class="navigation-item">
<a href="/de/categories/">🇩🇪</a>
<a href="/categories/">🇬🇧</a>
</li>
+2 -2
View File
@@ -138,14 +138,14 @@
<li class="navigation-item">
<a href="/">🇬🇧</a>
<a href="/de/">🇩🇪</a>
</li>
<li class="navigation-item">
<a href="/de/">🇩🇪</a>
<a href="/">🇬🇧</a>
</li>
+2 -2
View File
@@ -137,14 +137,14 @@
<li class="navigation-item">
<a href="/de/series/">🇩🇪</a>
<a href="/series/">🇬🇧</a>
</li>
<li class="navigation-item">
<a href="/series/">🇬🇧</a>
<a href="/de/series/">🇩🇪</a>
</li>
+18 -18
View File
@@ -20,6 +20,11 @@
/>
</url><url>
<loc>http://markinstefan.xyz/ru/categories/</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
@@ -30,18 +35,8 @@
hreflang="ru"
href="http://markinstefan.xyz/ru/categories/"
/>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/categories/"
/>
</url><url>
<loc>http://markinstefan.xyz/ru/series/</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/series/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
@@ -52,13 +47,13 @@
hreflang="ru"
href="http://markinstefan.xyz/ru/series/"
/>
</url><url>
<loc>http://markinstefan.xyz/ru/tags/</loc>
<xhtml:link
rel="alternate"
hreflang="ru"
href="http://markinstefan.xyz/ru/tags/"
hreflang="de"
href="http://markinstefan.xyz/de/series/"
/>
</url><url>
<loc>http://markinstefan.xyz/ru/tags/</loc>
<xhtml:link
rel="alternate"
hreflang="de"
@@ -69,6 +64,11 @@
hreflang="en"
href="http://markinstefan.xyz/tags/"
/>
<xhtml:link
rel="alternate"
hreflang="ru"
href="http://markinstefan.xyz/ru/tags/"
/>
</url><url>
<loc>http://markinstefan.xyz/ru/contact/</loc>
<xhtml:link
@@ -90,13 +90,13 @@
<loc>http://markinstefan.xyz/ru/</loc>
<xhtml:link
rel="alternate"
hreflang="en"
href="http://markinstefan.xyz/"
hreflang="de"
href="http://markinstefan.xyz/de/"
/>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://markinstefan.xyz/de/"
hreflang="en"
href="http://markinstefan.xyz/"
/>
<xhtml:link
rel="alternate"
+2 -2
View File
@@ -137,14 +137,14 @@
<li class="navigation-item">
<a href="/ru/tags/">🇷🇺</a>
<a href="/de/tags/">🇩🇪</a>
</li>
<li class="navigation-item">
<a href="/de/tags/">🇩🇪</a>
<a href="/ru/tags/">🇷🇺</a>
</li>
+8 -7
View File
@@ -1,6 +1,5 @@
<?php
require __DIR__ . '/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
@@ -10,7 +9,6 @@ use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->safeLoad();
function checkboxArrayToString($value)
{
if (is_array($value) && count($value) > 0) {
@@ -39,8 +37,8 @@ $first_name = trim($_POST['first_name'] ?? '');
$last_name = trim($_POST['last_name'] ?? '');
$name = trim("$first_name $last_name");
$email = trim($_POST['email'] ?? '');
$phone = trim($_POST['phone'] ?? '');
$email = trim($_POST['email'] ?? '');
$phone = trim($_POST['phone'] ?? '');
// Attendance
$attendance = $_POST['attendance'] ?? 'Unknown';
@@ -107,12 +105,13 @@ try {
$mail->CharSet = 'UTF-8';
$mail->isSMTP();
$mail->Host = gethostbyname($_ENV['SMTP_HOST']);
$mail->Host = $_ENV['SMTP_HOST'];
$mail->SMTPAuth = true;
$mail->Username = $_ENV['SMTP_USER'];
$mail->Password = $_ENV['SMTP_PASS'];
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = (int)$_ENV['SMTP_PORT'];
$mail->Timeout = 10;
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
$mail->addAddress($_ENV['TO_EMAIL']);
@@ -196,7 +195,6 @@ EOD;
$mail->Body = $body;
$mail->Timeout = 10;
$mail->send();
header('Location: /thank-you/');
@@ -204,5 +202,8 @@ $mail->Timeout = 10;
} catch (Exception $e) {
echo "RSVP could not be sent. Mailer Error: {$mail->ErrorInfo}";
error_log('RSVP mail error: ' . $mail->ErrorInfo);
http_response_code(500);
echo 'An error occurred while sending the RSVP.';
}