# PHP Form Redirect

**URL:** https://forum.kirupa.com/t/php-form-redirect/311072
**Category:** programming
**Created:** [June 26, 2010, 11:45pm UTC](https://forum.kirupa.com/t/php-form-redirect/311072 "2010-06-26T23:45:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![greygoose41](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@greygoose41](https://forum.kirupa.com/u/greygoose41)
#### Post date: [June 26, 2010, 11:45pm UTC](https://forum.kirupa.com/t/php-form-redirect/311072/1 "2010-06-26T23:45:19Z")

</div>

Followed tutorial for this site’s PHP Form Mailer. Form works and I receive data fine; however, when visitor clicks on “Submit” button, they see a page saying:  
Error 404: NOT FOUND!  
Your browser cannot find the document corresponding to the URL you typed in.

What do I need to correct? Below is the end of the php file:

mail($to = “[myemail@xx.com](mailto:myemail@xx.com)”, $subject = “Feedback Form”, $msg,$headers = “From: email” );  
if ($forward == 1) {  
header (“Location:$location”);  
}  
else {  
echo “Thank you for submitting our form. We will apply your coupon discount when you make your purchase.”;  
}  
?\>

I want the visitor to return to the home page.
