Re: sending a form

message from jennsite on 15 Jul 2004
Gary, I can't thank you enough! It's all working. Just some prettying up and
<?php

//trim whitespace

$name=stripslashes(trim($_POST['name']));
$email=stripslashes(trim($_POST['email']));
$company=stripslashes(trim($_POST['company']));
$message=stripslashes(trim($_POST['message']));

//check email is valid
if (!eregi("^[a-zA-Z0-9_\-\.\-\\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$",
$email))
{
header('location: error.html');
exit;
}
//set headers and format email content
$headers = "From: Courtroom Video: Website Enquiry
<jennsite@geary.k12.ok.us>\n";
$headers .= "Reply-To: ".$email."\n";
$headers .= "X-Sender: <jennsite@geary.k12.ok.us>\n";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 3\n";
$headers .= "Return-Path: <jennsite@geary.k12.ok.us>\n";
$toaddress = "jennsite@geary.k12.ok.us";
$mailcontent = "Customers Name: ".$name." \r\n"
."Customers Email: ".$email."\r\n"
."Customers Company: ".$company."\r\n"
."Message: ".$message."\r\n";

if(mail($toaddress,"Website enquiry from ".$name,$mailcontent,$headers)) {
header('location: thankyou.html');
exit;
 
Gary White replied to jennsite on 15 Jul 2004
Glad to hear it. You're welcome.

Gary
 

Archived message: Re: sending a form (Macromedia Dreamweaver Web Design)