# Redirect after contact form

**URL:** <https://forum.kirupa.com/t/redirect-after-contact-form/305732>\
**Category:** programming\
**Created:** [March 2, 2010, 8:54pm UTC](https://forum.kirupa.com/t/redirect-after-contact-form/305732 "2010-03-02T20:54:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fornes](https://avatars.discourse-cdn.com/v4/letter/f/e274bd/32.png) [@Fornes](https://forum.kirupa.com/u/Fornes)\
**Post date:** [March 2, 2010, 8:54pm UTC](https://forum.kirupa.com/t/redirect-after-contact-form/305732/1 "2010-03-02T20:54:03Z")

</div>

Hi!  
I’m new to PHP, so I used the tutorial [http://www.kirupa.com/web/php\_contact\_form4.htm](http://www.kirupa.com/web/php_contact_form4.htm) to create a contact form. When you press submit, it echoes a text, like “Thank you” on top of a blank page. This does not look very professional, and i would rather like it to redirect to a custom made thankyou.html. Is this possible? My sendmail.php looks like this now, I need to know what to replace the ‘Echo “Thanks”’ with:

\<?php  
if(isset($\_POST[‘submit’])) {

$to = “kontakt@jiffy-ub.no”;  
$subject = “Bestilling av hvit lue”;  
$name\_field = $\_POST[‘navn’];  
$email\_field = $\_POST[‘email’];  
$antall = $\_POST[‘antall’];  
$levering = $\_POST[‘levering’];

$body = “Bestillers navn: $name\_field  
E-Mail: $email\_field  
Antall: $antall  
Levering: $levering”;

echo “Thanks”;  
mail($to, $subject, $body);

} else {

echo “blarg!”;

}  
?\>
