# Launching a contact form thank-you page

**URL:** <https://forum.kirupa.com/t/launching-a-contact-form-thank-you-page/221018>\
**Category:** Uncategorized\
**Created:** [March 31, 2007, 5:50pm UTC](https://forum.kirupa.com/t/launching-a-contact-form-thank-you-page/221018 "2007-03-31T17:50:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cressa](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@cressa](https://forum.kirupa.com/u/cressa)\
**Post date:** [March 31, 2007, 5:50pm UTC](https://forum.kirupa.com/t/launching-a-contact-form-thank-you-page/221018/1 "2007-03-31T17:50:24Z")

</div>

Hello,

any kind chaps out there that can help with this?

instead of displaying the “Data has been submitted to…”  
how might i alter the code to launch a thank you page  
using “header” and if sending fails make it launch an  
error page?

its the code provided in the php tutorial section. i  
want to keep it simple cos im certainly no progammer!

thanks

```php
<?php
if(isset($_POST['submit'])) {

    $to = "info@conflictingpixels.com"; 
    $subject = "MK Removals Website Contact Form";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];
    $option = $_POST['radio'];
    $dropdown = $_POST['drop_down'];

    foreach($_POST['check'] as $value) {
        $check_msg .= "Checked: $value
";
    }
    
    $body = "From: $name_field
 E-Mail: $email_field
 $check_msg Option: $option
 Drop-Down: $dropdown
 Message:
 $message
";

    echo "Data has been submitted to $to!";
    mail($to, $subject, $body);
    
} else {
    echo "blarg!";
}
?>

```
