debugging rsvp-submit.php
This commit is contained in:
1 parent
7ac460bb1c
commit
37b11df74b
1 file changed
+21
-6
+21
-6
@@ -1,4 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
file_put_contents('/tmp/rsvp-debug.log', "1\n", FILE_APPEND);
|
||||||
|
|
||||||
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
file_put_contents('/tmp/rsvp-debug.log', "2\n", FILE_APPEND);
|
||||||
|
|
||||||
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
|
use PHPMailer\PHPMailer\Exception;
|
||||||
|
use Dotenv\Dotenv;
|
||||||
|
|
||||||
|
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
|
||||||
|
$dotenv->safeLoad();
|
||||||
|
|
||||||
|
file_put_contents('/tmp/rsvp-debug.log', "3\n", FILE_APPEND);
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
@@ -97,6 +112,7 @@ foreach ($fields as &$field) {
|
|||||||
$field = mb_convert_encoding($field, 'UTF-8', 'auto');
|
$field = mb_convert_encoding($field, 'UTF-8', 'auto');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_put_contents('/tmp/rsvp-debug.log', "4\n", FILE_APPEND);
|
||||||
$mail = new PHPMailer(true);
|
$mail = new PHPMailer(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -193,13 +209,12 @@ EOD;
|
|||||||
|
|
||||||
$mail->Body = $body;
|
$mail->Body = $body;
|
||||||
|
|
||||||
file_put_contents(
|
file_put_contents('/tmp/rsvp-debug.log', "5\n", FILE_APPEND);
|
||||||
__DIR__ . '/debug.txt',
|
$mail->send();
|
||||||
print_r($_POST, true)
|
file_put_contents('/tmp/rsvp-debug.log', "6\n", FILE_APPEND);
|
||||||
);
|
|
||||||
|
|
||||||
echo "PHP WORKS";
|
header('Location: /thank-you/');
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user