PHP8.0 has caused form to e-mail to stop working
This script, which previously worked, is now causing an HTTP 500 error:
<?php
if ("" === "") {
$WAFV_Redirect = "contact.php?v=1";
$_SESSION['WAVT_thankyou_166_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateAN(((isset($_POST["FORMname"]))?$_POST["FORMname"]:"") . "",true,true,false,true,"'-,",true,1);
$WAFV_Errors .= WAValidateAN(((isset($_POST["FORMphone"]))?$_POST["FORMphone"]:"") . "",false,false,true,true,"()-+",false,2);
$WAFV_Errors .= WAValidateEM(((isset($_POST["FORMemail"]))?$_POST["FORMemail"]:"") . "",true,3);
$WAFV_Errors .= WAValidateAN(((isset($_POST["FORMenquiry"]))?$_POST["FORMenquiry"]:"") . "",true,true,true,true,",.;:'\r\n-!"£$%&()?",true,4);
$WAFV_Errors .= WAValidateAN(((isset($_POST["FORMsubject"]))?$_POST["FORMsubject"]:"") . "",true,true,true,true,",.;:'@-+!"£$%&()",true,5);
$WAFV_Errors .= WAValidateRT(((isset($_POST["FORMenquiry"]))?$_POST["FORMenquiry"]:"") . "","http://|http://, https://|https://, bitcoin|bitcoin, @|@",true,6);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"thankyou_166");
}
}
?>
<?php require_once("webassist/email/WA_Email.php"); ?>
<?php
if ("" === "") { //WA Universal Email
$Email = new WA_Email("waue_thankyou_1");
$Email->Redirect = "contact.php?m=1";
$Email->From = "" . $rsDIR->getColumnVal("NJdirTITLE") ." <". $formemail .">";
$Email->Importance = "1";
$Email->ReplyTo = "".((isset($_POST["FORMemail"]))?$_POST["FORMemail"]:"") ."";
$Email->BurstSize = "200";
$Email->BurstTime = "1";
$Email->WaitTime = "1";
$Email->Method = "smtp";
$Email->Host = "smtp.livemail.co.uk";
$Email->Port = "587";
$Email->SMTPAuth = true;
$Email->SMTPSecure = "tls";
$Email->Username = "". $formemail ."";
$Email->Password = "". $emailpw ."";
$Email->addTo("". $formemail ."");
$Email->addBCC("info@nathonjones.com");
$Email->BodyFile = "emailreceipt.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "" . $rsDIR->getColumnVal("NJdirTITLE") ." - Website Enquiry";
$Email->send($emailGroup);
}
$Email->close();
}
?>
The error logs came back with this:
[Wed Mar 08 14:08:35.107062 2023] [fcgid:warn] [pid 128772] [client 86.158.250.229:17285] mod_fcgid: stderr: #0 /home/storage/700/4042700/user/htdocs/webassist/form_validations/wavt_scripts_php.php(58): SaveFormToSession(',7', 'thankyou_166'), referer: https://silverfoxweddingcars.co.uk/contact.php?v=1
[Wed Mar 08 14:08:35.107068 2023] [fcgid:warn] [pid 128772] [client 86.158.250.229:17285] mod_fcgid: stderr: #1 /home/storage/700/4042700/user/htdocs/thankyou.php(25): PostResult('contact.php?v=1', ',7', 'thankyou_166'), referer: https://silverfoxweddingcars.co.uk/contact.php?v=1
[Wed Mar 08 14:08:35.107081 2023] [fcgid:warn] [pid 128772] [client 86.158.250.229:17285] mod_fcgid: stderr: #2 {main}, referer: https://silverfoxweddingcars.co.uk/contact.php?v=1
[Wed Mar 08 14:08:35.107085 2023] [fcgid:warn] [pid 128772] [client 86.158.250.229:17285] mod_fcgid: stderr: thrown in /home/storage/700/4042700/user/htdocs/webassist/form_validations/wavt_scripts_php.php on line 38, referer: https://silverfoxweddingcars.co.uk/contact.php?v=1
Any idea what could be causing this? Thank you.
Regards
NJ