Gosh, that title was a bit of a mouthful.
Basically my question is quite hard to explain due to my bare knowledge of PHP but I have a contact form that once the submit button has been pressed, processes through an engine, then redirects to a confirmation page if all has worked out.
This confirmation page is a html document that is literally a h1 tag with some text, what I would like to do is have a confirmation show up on the original page with the contact form on it as a javascript notification (a NotifyJS type one)
My file structure: contact form: contact.html > contactengine.php (if no errors) > contactthanks.php
Here is the code
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Here is the plugin I want to use for the error https://notifyjs.com/
This is my confirmation notification, that I want the contactthanks.php message to show up on (on the original page)
$.notify("Email sent succesfully");
Thanks in advance, been trying heaps of different things but I'm just getting nowhere, can't find any answers that make sense to me also.