I've been struggling with this form function for the past couple of days and I'm close to having it done! When I click the submit button I just get a blank white screen instead of a pop up of a thank you note and I also dont get an email as I should so I know something is off.
ive tried isset() and messing around with xampp but now I have the site being hosted and I'm running into the white screen
This is the php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';
$DATE = htmlspecialchars($_POST['DATE']);
$TIME = htmlspecialchars($_POST['TIME']);
$NAME = htmlspecialchars($_POST['NAME']);
$ORDER = htmlspecialchars($_POST['ORDER']);
$EMAIL = htmlspecialchars($_POST['EMAIL']);
$mail = new PHPMailer;
$mail->From = "$EMAIL";
$mail->FromName = "$NAME";
$mail->addAddress("ric*****@gmail.com");
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "$DATE $TIME \n\r $NAME \n\r $ORDER";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
?>
I want the pop up contact message to appear and an email received to the one listed