debugging rsvp-submit.php
This commit is contained in:
1 parent
891ffce73e
commit
2f1de8f764
11 files changed
+61
-59
No files matched your search
@@ -137,14 +137,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/ru/categories/">🇷🇺</a>
|
<a href="/de/categories/">🇩🇪</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/de/categories/">🇩🇪</a>
|
<a href="/ru/categories/">🇷🇺</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -136,14 +136,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/ru/404.html">🇷🇺</a>
|
<a href="/404.html">🇬🇧</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/404.html">🇬🇧</a>
|
<a href="/ru/404.html">🇷🇺</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,11 @@
|
|||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/de/categories/</loc>
|
<loc>http://markinstefan.xyz/de/categories/</loc>
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="de"
|
||||||
|
href="http://markinstefan.xyz/de/categories/"
|
||||||
|
/>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
@@ -30,11 +35,6 @@
|
|||||||
hreflang="ru"
|
hreflang="ru"
|
||||||
href="http://markinstefan.xyz/ru/categories/"
|
href="http://markinstefan.xyz/ru/categories/"
|
||||||
/>
|
/>
|
||||||
<xhtml:link
|
|
||||||
rel="alternate"
|
|
||||||
hreflang="de"
|
|
||||||
href="http://markinstefan.xyz/de/categories/"
|
|
||||||
/>
|
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/de/hochzeit/</loc>
|
<loc>http://markinstefan.xyz/de/hochzeit/</loc>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
|
|||||||
+10
-10
@@ -20,6 +20,11 @@
|
|||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/categories/</loc>
|
<loc>http://markinstefan.xyz/categories/</loc>
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="de"
|
||||||
|
href="http://markinstefan.xyz/de/categories/"
|
||||||
|
/>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
@@ -30,11 +35,6 @@
|
|||||||
hreflang="ru"
|
hreflang="ru"
|
||||||
href="http://markinstefan.xyz/ru/categories/"
|
href="http://markinstefan.xyz/ru/categories/"
|
||||||
/>
|
/>
|
||||||
<xhtml:link
|
|
||||||
rel="alternate"
|
|
||||||
hreflang="de"
|
|
||||||
href="http://markinstefan.xyz/de/categories/"
|
|
||||||
/>
|
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/contact/</loc>
|
<loc>http://markinstefan.xyz/contact/</loc>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
@@ -139,11 +139,6 @@
|
|||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/tags/</loc>
|
<loc>http://markinstefan.xyz/tags/</loc>
|
||||||
<xhtml:link
|
|
||||||
rel="alternate"
|
|
||||||
hreflang="ru"
|
|
||||||
href="http://markinstefan.xyz/ru/tags/"
|
|
||||||
/>
|
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="de"
|
hreflang="de"
|
||||||
@@ -154,5 +149,10 @@
|
|||||||
hreflang="en"
|
hreflang="en"
|
||||||
href="http://markinstefan.xyz/tags/"
|
href="http://markinstefan.xyz/tags/"
|
||||||
/>
|
/>
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="ru"
|
||||||
|
href="http://markinstefan.xyz/ru/tags/"
|
||||||
|
/>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
@@ -10,7 +9,6 @@ use Dotenv\Dotenv;
|
|||||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
||||||
$dotenv->safeLoad();
|
$dotenv->safeLoad();
|
||||||
|
|
||||||
|
|
||||||
function checkboxArrayToString($value)
|
function checkboxArrayToString($value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && count($value) > 0) {
|
if (is_array($value) && count($value) > 0) {
|
||||||
@@ -39,8 +37,8 @@ $first_name = trim($_POST['first_name'] ?? '');
|
|||||||
$last_name = trim($_POST['last_name'] ?? '');
|
$last_name = trim($_POST['last_name'] ?? '');
|
||||||
$name = trim("$first_name $last_name");
|
$name = trim("$first_name $last_name");
|
||||||
|
|
||||||
$email = trim($_POST['email'] ?? '');
|
$email = trim($_POST['email'] ?? '');
|
||||||
$phone = trim($_POST['phone'] ?? '');
|
$phone = trim($_POST['phone'] ?? '');
|
||||||
|
|
||||||
// Attendance
|
// Attendance
|
||||||
$attendance = $_POST['attendance'] ?? 'Unknown';
|
$attendance = $_POST['attendance'] ?? 'Unknown';
|
||||||
@@ -107,12 +105,13 @@ try {
|
|||||||
$mail->CharSet = 'UTF-8';
|
$mail->CharSet = 'UTF-8';
|
||||||
|
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
$mail->Host = gethostbyname($_ENV['SMTP_HOST']);
|
$mail->Host = $_ENV['SMTP_HOST'];
|
||||||
$mail->SMTPAuth = true;
|
$mail->SMTPAuth = true;
|
||||||
$mail->Username = $_ENV['SMTP_USER'];
|
$mail->Username = $_ENV['SMTP_USER'];
|
||||||
$mail->Password = $_ENV['SMTP_PASS'];
|
$mail->Password = $_ENV['SMTP_PASS'];
|
||||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||||
$mail->Port = (int)$_ENV['SMTP_PORT'];
|
$mail->Port = (int)$_ENV['SMTP_PORT'];
|
||||||
|
$mail->Timeout = 10;
|
||||||
|
|
||||||
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
|
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
|
||||||
$mail->addAddress($_ENV['TO_EMAIL']);
|
$mail->addAddress($_ENV['TO_EMAIL']);
|
||||||
@@ -196,7 +195,6 @@ EOD;
|
|||||||
|
|
||||||
$mail->Body = $body;
|
$mail->Body = $body;
|
||||||
|
|
||||||
$mail->Timeout = 10;
|
|
||||||
$mail->send();
|
$mail->send();
|
||||||
|
|
||||||
header('Location: /thank-you/');
|
header('Location: /thank-you/');
|
||||||
@@ -204,5 +202,8 @@ $mail->Timeout = 10;
|
|||||||
|
|
||||||
} catch (Exception $e) {
|
} 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.';
|
||||||
}
|
}
|
||||||
@@ -137,14 +137,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/categories/">🇬🇧</a>
|
<a href="/de/categories/">🇩🇪</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/de/categories/">🇩🇪</a>
|
<a href="/categories/">🇬🇧</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -138,14 +138,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/">🇬🇧</a>
|
<a href="/de/">🇩🇪</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/de/">🇩🇪</a>
|
<a href="/">🇬🇧</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -137,14 +137,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/de/series/">🇩🇪</a>
|
<a href="/series/">🇬🇧</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/series/">🇬🇧</a>
|
<a href="/de/series/">🇩🇪</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -20,6 +20,11 @@
|
|||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/ru/categories/</loc>
|
<loc>http://markinstefan.xyz/ru/categories/</loc>
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="de"
|
||||||
|
href="http://markinstefan.xyz/de/categories/"
|
||||||
|
/>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
@@ -30,18 +35,8 @@
|
|||||||
hreflang="ru"
|
hreflang="ru"
|
||||||
href="http://markinstefan.xyz/ru/categories/"
|
href="http://markinstefan.xyz/ru/categories/"
|
||||||
/>
|
/>
|
||||||
<xhtml:link
|
|
||||||
rel="alternate"
|
|
||||||
hreflang="de"
|
|
||||||
href="http://markinstefan.xyz/de/categories/"
|
|
||||||
/>
|
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/ru/series/</loc>
|
<loc>http://markinstefan.xyz/ru/series/</loc>
|
||||||
<xhtml:link
|
|
||||||
rel="alternate"
|
|
||||||
hreflang="de"
|
|
||||||
href="http://markinstefan.xyz/de/series/"
|
|
||||||
/>
|
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
@@ -52,13 +47,13 @@
|
|||||||
hreflang="ru"
|
hreflang="ru"
|
||||||
href="http://markinstefan.xyz/ru/series/"
|
href="http://markinstefan.xyz/ru/series/"
|
||||||
/>
|
/>
|
||||||
</url><url>
|
|
||||||
<loc>http://markinstefan.xyz/ru/tags/</loc>
|
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="ru"
|
hreflang="de"
|
||||||
href="http://markinstefan.xyz/ru/tags/"
|
href="http://markinstefan.xyz/de/series/"
|
||||||
/>
|
/>
|
||||||
|
</url><url>
|
||||||
|
<loc>http://markinstefan.xyz/ru/tags/</loc>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="de"
|
hreflang="de"
|
||||||
@@ -69,6 +64,11 @@
|
|||||||
hreflang="en"
|
hreflang="en"
|
||||||
href="http://markinstefan.xyz/tags/"
|
href="http://markinstefan.xyz/tags/"
|
||||||
/>
|
/>
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="ru"
|
||||||
|
href="http://markinstefan.xyz/ru/tags/"
|
||||||
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>http://markinstefan.xyz/ru/contact/</loc>
|
<loc>http://markinstefan.xyz/ru/contact/</loc>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
@@ -90,13 +90,13 @@
|
|||||||
<loc>http://markinstefan.xyz/ru/</loc>
|
<loc>http://markinstefan.xyz/ru/</loc>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="de"
|
||||||
href="http://markinstefan.xyz/"
|
href="http://markinstefan.xyz/de/"
|
||||||
/>
|
/>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="de"
|
hreflang="en"
|
||||||
href="http://markinstefan.xyz/de/"
|
href="http://markinstefan.xyz/"
|
||||||
/>
|
/>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
|
|||||||
@@ -137,14 +137,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/ru/tags/">🇷🇺</a>
|
<a href="/de/tags/">🇩🇪</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a href="/de/tags/">🇩🇪</a>
|
<a href="/ru/tags/">🇷🇺</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
@@ -10,7 +9,6 @@ use Dotenv\Dotenv;
|
|||||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
||||||
$dotenv->safeLoad();
|
$dotenv->safeLoad();
|
||||||
|
|
||||||
|
|
||||||
function checkboxArrayToString($value)
|
function checkboxArrayToString($value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && count($value) > 0) {
|
if (is_array($value) && count($value) > 0) {
|
||||||
@@ -39,8 +37,8 @@ $first_name = trim($_POST['first_name'] ?? '');
|
|||||||
$last_name = trim($_POST['last_name'] ?? '');
|
$last_name = trim($_POST['last_name'] ?? '');
|
||||||
$name = trim("$first_name $last_name");
|
$name = trim("$first_name $last_name");
|
||||||
|
|
||||||
$email = trim($_POST['email'] ?? '');
|
$email = trim($_POST['email'] ?? '');
|
||||||
$phone = trim($_POST['phone'] ?? '');
|
$phone = trim($_POST['phone'] ?? '');
|
||||||
|
|
||||||
// Attendance
|
// Attendance
|
||||||
$attendance = $_POST['attendance'] ?? 'Unknown';
|
$attendance = $_POST['attendance'] ?? 'Unknown';
|
||||||
@@ -107,12 +105,13 @@ try {
|
|||||||
$mail->CharSet = 'UTF-8';
|
$mail->CharSet = 'UTF-8';
|
||||||
|
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
$mail->Host = gethostbyname($_ENV['SMTP_HOST']);
|
$mail->Host = $_ENV['SMTP_HOST'];
|
||||||
$mail->SMTPAuth = true;
|
$mail->SMTPAuth = true;
|
||||||
$mail->Username = $_ENV['SMTP_USER'];
|
$mail->Username = $_ENV['SMTP_USER'];
|
||||||
$mail->Password = $_ENV['SMTP_PASS'];
|
$mail->Password = $_ENV['SMTP_PASS'];
|
||||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||||
$mail->Port = (int)$_ENV['SMTP_PORT'];
|
$mail->Port = (int)$_ENV['SMTP_PORT'];
|
||||||
|
$mail->Timeout = 10;
|
||||||
|
|
||||||
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
|
$mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']);
|
||||||
$mail->addAddress($_ENV['TO_EMAIL']);
|
$mail->addAddress($_ENV['TO_EMAIL']);
|
||||||
@@ -196,7 +195,6 @@ EOD;
|
|||||||
|
|
||||||
$mail->Body = $body;
|
$mail->Body = $body;
|
||||||
|
|
||||||
$mail->Timeout = 10;
|
|
||||||
$mail->send();
|
$mail->send();
|
||||||
|
|
||||||
header('Location: /thank-you/');
|
header('Location: /thank-you/');
|
||||||
@@ -204,5 +202,8 @@ $mail->Timeout = 10;
|
|||||||
|
|
||||||
} catch (Exception $e) {
|
} 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.';
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user