This is my process.php code....
<?php
include('data_valid_fns.php');
// create short variable names
$name=$HTTP_POST_VARS['name'];
$your_email=$HTTP_POST_VARS['email'];
$phone=$HTTP_POST_VARS['phone'];
$address=$HTTP_POST_VARS['address'];
$inform=$HTTP_POST_VARS['inform'];
$rep=$HTTP_POST_VARS['rep[]'];
$message = $HTTP_POST_VARS['message'];
//rep is the variable that isnt checked
// check form filled in
if (!filled_out($HTTP_POST_VARS))
{
echo 'Please go back and enter your details.
<a href="takeaction.htm">Return to fill out form details</a>';
exit;
}
// email address not valid
if (!valid_email($your_email))
{
echo 'Please enter a valid email address.
<a href="takeaction.htm">Return to enter a valid email address</a>';
exit;
}
if ($inform==1)
{
//ADD PERSON TO FILE
exit;
}
// email TDs
if ($HTTP_POST_VARS['submit'] && !empty($rep)) {
if (!empty($rep))
$email=implode(',',$rep);
else
'Please go back and enter your details.
<a href="takeaction.htm">Return to fill out form details</a>';
//default
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From:postmaster@site.com\n";
$subject = $HTTP_POST_VARS['subject'];
$content = $name."\n"
.$your_email."\n"
.$address."\n"
.$phone."\n"
.$message."\n";
mail($email,$subject,$content,$headers);
// Redirect to thankyou-page
header('Location: [url]http://www.site.com/thanks.htm[/url]');
}
?>