session_start();
include_once ('securimage/securimage.php');
$securimage = new Securimage();
if (isset($_POST['posted'])) {
// assign our vars.
// saletype, advertisement,contact,phone,email,length,location
$answers = array();
$answers['saletype'] = $_POST['saletype'];
$answers['advertisement'] = $_POST['advertisement'];
$answers['contact'] = $_POST['contact'];
$answers['phone'] = $_POST['phone'];
$answers['email'] = $_POST['email'];
$answers['location'] = $_POST['location'];
$answers['length'] = $_POST['length'];
if (block_regan($answers)) {
die('Sorry, but your contact details are known to us as an irreputable source, and as such you are unable to place ads. If you feel that you have been misidentified, please feel free to contact us at info@triumphclub.co.nz');
}
$errors = array();
if ($securimage->check($_POST['captcha_code']) == false) {
$errors['captcha_error'] = 1;
}
if (!isset($answers['saletype']) || $answers['saletype'] == "")
$errors['saletype_error'] = 1;
if (!isset($answers['advertisement']) || $answers['advertisement'] == "")
$errors['advertisement_error'] = 1;
if (!isset($answers['contact']) || $answers['contact'] == "")
$errors['contact_error'] = 1;
if (!isset($answers['phone']) || $answers['phone'] == "")
$errors['phone_error'] = 1;
// if (!isset($answers['email']) || validate_email($answers['email']) == 0)
// $errors['email_error'] = 1;
if (!isset($answers['location']) || $answers['location'] == "")
$errors['location_error'] = 1;
if (!isset($answers['length']) || $answers['length'] == "")
$errors['length_error'] = 1;
if (count($errors) > 0)
make_html($errors,$answers);
else {
// save it to xml
$xml = "
» FOR SALE ADVERTISEMENT FORM |
|