Hi Ray, thanks so much for the help earlier. I'm now working on rolling out the changes across the whole site, so I've moved the new email scripts into a shared file so that I can include the file on each page where I have the contact form. However I've found that if the submission fails, it redirects to the homepage and not the current page with ?sent=false#failure appended. Current code is:
<?php
if (isset($_POST['FPCheck']) && $_POST['FPCheck'] == "") {
$WAFV_Redirect = "?sent=false#failure";
$_SESSION['WAVT_counselling2_682_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM($recaptchaScore . "",0.5,1,"",",.",true,1);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"counselling2_682");
}
}
?>
I thought the $WAFV_Redirect = $_SERVER["PHP_SELF"] would do it, also tried changing it $WAFV_Redirect = $_SERVER["REQUEST_URI"] but didn't work. What should I change to make it redirect to the current page?