# PHP Contact Form

**URL:** <https://forum.kirupa.com/t/php-contact-form/207753>\
**Category:** Uncategorized\
**Created:** [November 21, 2006, 7:20am UTC](https://forum.kirupa.com/t/php-contact-form/207753 "2006-11-21T07:20:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahrizansaad](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@shahrizansaad](https://forum.kirupa.com/u/shahrizansaad)\
**Post date:** [November 21, 2006, 7:20am UTC](https://forum.kirupa.com/t/php-contact-form/207753/1 "2006-11-21T07:20:08Z")

</div>

Dear everybody who is really can help me.

I just finish do it my contact form and all the data has been seen correctly  
to desire mail.But the problem is i dont know how to redirect the page into  
desire page after email has been send.

Hope u guys can help me to put coding ini this given coding that can be  
redirect to desire page after people pressing submit button.

here is the coding.

[COLOR=royalblue]\<?php [/COLOR]  
[COLOR=royalblue]if(isset($\_POST[‘submit’])) { [/COLOR]  
[COLOR=royalblue]$to = “[/COLOR][[COLOR=royalblue]shahrizans@gmail.com[/COLOR]](mailto:shahrizans@gmail.com)[COLOR=royalblue]”; [/COLOR]  
[COLOR=royalblue]$subject = “Contact Form”; [/COLOR]  
[COLOR=royalblue]$name\_field = $\_POST[‘name’]; [/COLOR]  
[COLOR=royalblue]$email\_field = $\_POST[‘email’]; [/COLOR]  
[COLOR=royalblue]$message = $\_POST[‘message’]; [/COLOR]

[COLOR=royalblue]$body = “From: $name\_field  
E-Mail: $email\_field  
Message:  
$message”; [/COLOR]

[COLOR=royalblue]echo “Thank You, Your Message Has Been Submitted to $to!”; [/COLOR]  
[COLOR=royalblue]mail($to, $subject, $body); [/COLOR]  
[COLOR=royalblue]} else { [/COLOR]  
[COLOR=royalblue]echo “Error On Page!”; [/COLOR]  
[COLOR=royalblue]} [/COLOR]  
[COLOR=royalblue]?\>[/COLOR]
