Problem with PHP Header() url
-
My apologies if this is posted elsewhere, but I have searched for a while and cannot find a resolution.
I have a contact form where the action is to call a php script using the post method. The php script is named phpmailer2.php. This works fine, the email is sent, and then I would like to send the user back to the contact page with a parameter in the URL (i.e. ?page-id=19&success=YES).
I am using the following php header statement to redirect the user back to the page:
header('Location: ?pageID=19&success=YES');
After the form is submitted, the header statement is executed, but the url ends up including the base name. So the url looks like:
‘https://estrellapalooza.com/wp/wp-content/themes/hero/phpmailer2.php?pageID=19&success=YES’.
Can anyone suggest a solution to removing phpmailer2.php from the url?
Any help is greatly appreciated.
Thanks,
Rob
- The topic ‘Problem with PHP Header() url’ is closed to new replies.