So would the following be right
<?php
$error = '';
// get all the email form data
$ems = '';
// stop email server hacks
$ems .= $message;
$ems .= $subject;
$ems .= $address;
if ( stristr( $ems, 'content-type:' ) ¦¦ stristr( $ems, 'multipart/mixed' ) ¦¦ stristr( $ems, 'boundary="' ) ¦¦ stristr( $ems, 'cc:' ) ¦¦ stristr( $ems, 'multi-part message in mime format' ) ¦¦ stristr( $ems, 'to:' ) ¦¦ eregi( "(%[a-f0-9])", $ems ) ¦¦ stristr( $ems, '0x' ))
// the last two are in case they try using hex or other non standard characters
{
$error .= "<p>Don't bother</p>";
}
if ( $error )
{
echo $error;
}
else
{
$msg = "My Website Online Contact Submission";
$msg .= "Name: $name";
$msg .= "Comments: $emailAddress";
$msg .= "Comments: $phone";
$msg .= "Comments: $message";
// Edit if it is nessecery
$to = "$toaddress";
$subject = "CONTACT PAGE FROM WEBSITE";
$mailheaders = "From: Website Submission Form <$emailAddress>";
$mailheaders .= "Reply-To:$Email_Address <$emailAddress>";
// Mail to address
mail ( $to, $subject, $msg, $mailheaders );
}
?>
[ Message was edited by: redgtsviper 02/28/2006 09:08 pm ]
|