I have an enquiry form that sends using a separate php script. When the forms sends a success message displays on a blank page. How can I get this message to display on the page with the actual form?
This is the part of the php script that deals with the success message
// now we just send the message if (@mail($to, $subject, $message, $headers)) { echo "Thanks for sending your details. We will be in touch soon."; } else { echo "Failed to send";
As I can understand, the code portion you posted here belongs to the separate script which sends email and so when the message has been sent, it displays the success message in a blank page.
You should enclose the code of the separate script in a function you pass parameters to
and make this function return true or false. Based on this you should display the message in your original page.
You should enclose the code of the separate script in a function you pass parameters to
and make this function return true or false. Based on this you should display the message in your original page.
Cheers