Make php post the error/success message on the same page as the form - no need to direct to a different page

By “instead of directing to a new page” do you mean to keep the code in the same file as StarLion suggests, or do you mean you want to use AJAX to handle the form submission so there is no page redraw in the browser?