I\'m having an issue with the header(\"Location: index.php?action=messagesent\") it will not redirect after The user presses submit and the php is ran. Normally it will redi
A header(Location: ...)
will only work if you have not already sent output to the browser.
Earlier in your script you output the form, hence header()
fails with an error message.
If you look in your error log, you will see the error message.
Add error reporting to the top of your file(s) while testing right after your opening PHP tag for example
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
Now you will see the errors on the browser page.