# PHP contact form .. "thank you" page redirect?

**URL:** <https://forum.kirupa.com/t/php-contact-form-thank-you-page-redirect/169556>\
**Category:** programming\
**Created:** [November 17, 2005, 4:54am UTC](https://forum.kirupa.com/t/php-contact-form-thank-you-page-redirect/169556 "2005-11-17T04:54:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstrpln](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@mstrpln](https://forum.kirupa.com/u/mstrpln)\
**Post date:** [November 17, 2005, 4:54am UTC](https://forum.kirupa.com/t/php-contact-form-thank-you-page-redirect/169556/1 "2005-11-17T04:54:52Z")

</div>

So I have used the PHP contact form that could be found on [kirupa.com](http://kirupa.com).

I was wondering how I can modify this script so that once a person clicks on the “submit” button, that the page will redirect to a “thankyou.html” page to confirm that the message has been sent, rather than the “Data has been submitted to” message … any ideas? do i replace the echo message with a URL?

i’m a total n00b at PHP. 😑

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

```
$to = "stefan@mstrpln.com"; 
$subject = "from MSTRPLN website 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!”;  
}  
?\>
