11-11-2008, 07:20 PM
|
#10 (permalink)
|
|
The Contributor
Join Date: Oct 2008
Posts: 75
Thanks: 4
|
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"); }
?>
|
|
|
|