Thread: else problem
View Single Post
Old 11-11-2008, 07:20 PM   #10 (permalink)
9three
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default

PHP Code:
<?php

$name 
$_POST['name']; //senders name
$phone $_POST['phone'];
$website $_POST['website'];
$email $_POST['email']; //senders e-mail adress
$recipient "info@url.com"//recipient
$message $_POST['message']; //mail body
$subject "Client Request"//subject
$header "From: "$name " <" $email ">\r\n"//optional headerfields
$body "Name: "$name ."

         Phone: "
.$phone.
         
         Website: "
.$website.
         
         Email:"
.$email.
         
         Message: "
.$message."\r\n";
         
if ( !empty(
$_POST['name']) || !empty($_POST['phone']) || !empty($_POST['email']) || !empty($_POST['message'])){
    
header("Location: http://www.url.com/error.php");
} else { if (
mail($recipient$subject$body$header))
      
header("Location: http://www.url.com/thanks.php");
}

?>
9three is offline  
Reply With Quote