How to display success message after form submission? There are 2 general ways to show a message after submitting an HTML form: 1 Use Javascript AJAX to submit the form and show a message when the processing is complete. 2 Submit the form as usual, and have the server-side script pass back a flag to show the message.
How to get the success message in the same page after submitting the contact form?
If you want the same form page displayed again after submission with results, you will make the action the same page and include the processing script at the beginning of the file. Instead of echoing the result message within the processor as you have, store it as a variable which can be output in the html form page.