OK heres my code - process.php.....
<?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 name for checkboxes
// inform is another checkbox
// this file only tests the other fields
// 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;
}
and here is my data_valid_fns.php...
<?php
function filled_out($HTTP_POST_VARS)
{
// test that each variable has a value
foreach ($HTTP_POST_VARS as $key => $value)
{
if (!isset($key) || ($value == ''))
return false;
}
return true;
}
Please, please help