View Single Post
  #6 (permalink)  
Old May 5th, 2008, 20:25
CloudedVision's Avatar
CloudedVision CloudedVision is offline
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: Directing user to a "thanks" page

Personally I wouldn't do an HTTP redirect unless absolutely necessary. I would do something like this:

PHP: Select all

<?php 
if(isset($_POST['submit'])) { 
$to "xxxxxxxxxx@hotmail.com"
$subject "Matchday Programmes"
$name_field $_POST['name']; 
$email_field $_POST['email']; 
$message $_POST['message']; 
 
$body "From: $name_field\n E-Mail: $email_field\n Message:\n $message"
 
if(
mail($to$subject$body)) {?>Thank you message
<?php} else {?>Error message
<?php
} else { ?>Contact form
<?php 
?>
And I also added error handling in there, which is always a plus.
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Reply With Quote