<?php
----------------------------------------------------
-----
----- This script was generated by PHP-Form Wizard 1.2.5 on 29/07/2008 at 10:24:17 a.m.
-----
-----
----------------------------------------------------
// Receiving variables
@$pfw_ip= $SERVER['REMOTE_ADDR'];
@$EmailFrom = addslashes($POST['EmailFrom']);
@$First_Name = addslashes($POST['First_Name']);
@$Last_Name = addslashes($POST['Last_Name']);
@$Address = addslashes($POST['Address']);
@$Town = addslashes($POST['Town']);
@$City = addslashes($POST['City']);
@$WorkTel = addslashes($POST['WorkTel']);
@$HomeTel = addslashes($POST['HomeTel']);
@$Mobile = addslashes($POST['Mobile']);
@$Pets_Name = addslashes($POST['Pets_Name']);
@$Breed = addslashes($POST['Breed']);
@$Dogs_Colour = addslashes($POST['Dogs_Colour']);
@$Male_or_Female = addslashes($POST['Male_or_Female']);
@$Spayed_or_Neutered = addslashes($POST['Spayed_or_Neutered']);
@$Vets_Name_Address = addslashes($POST['Vets_Name_Address']);
@$Pets_Birth_Date = addslashes($POST['Pets_Birth_Date']);
@$Last_Vacation_Date = addslashes($POST['Last_Vacation_Date']);
@$How_did_you_find_out_about_Smart_Dogs = addslashes($POST['How_did_you_find_out_about_Smart_Dogs']);
@$Special_Instructions = addslashes($POST['Special_Instructions']);
@$Terms_and_conditions_of_trade = addslashes($POST['Terms_and_conditions_of_trade']);
@$Disclaimer = addslashes($POST['Disclaimer']);
@$Promotion_code = addslashes($_POST['Promotion_code']);
// Validation
if (! ereg('[A-Za-z0-9-]+@[A-Za-z0-9-]+.[A-Za-z0-9_-]+', $EmailFrom))
{
header("Location: registration_emailerror.htm");
exit;
}
if (strlen($EmailFrom) == 0 )
{
header("Location: registration_emailerror.htm");
exit;
}
if (strlen($First_Name) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Last_Name) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Address) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($HomeTel) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Pets_Name) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Breed) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Dogs_Colour) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Male_or_Female) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Spayed_or_Neutered) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Terms_and_conditions_of_trade) == 0 )
{
header("Location: registration_error.htm");
exit;
}
if (strlen($Disclaimer) == 0 )
{
header("Location: registration_error.htm");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $EmailFrom\n";
. "Reply-To: $EmailFrom\n"
$pfw_subject = "Smart Dogs Registration";
$pfw_email_to = "carl@smartdogs.co.nz";
$pfw_message = "Visitor's IP: $pfw_ip\n";
. "EmailFrom: $EmailFrom\n"
. "First_Name: $First_Name\n"
. "Last_Name: $Last_Name\n"
. "Address: $Address\n"
. "Town: $Town\n"
. "City: $City\n"
. "WorkTel: $WorkTel\n"
. "HomeTel: $HomeTel\n"
. "Mobile: $Mobile\n"
. "Pets_Name: $Pets_Name\n"
. "Breed: $Breed\n"
. "Dogs_Colour: $Dogs_Colour\n"
. "Male_or_Female: $Male_or_Female\n"
. "Spayed_or_Neutered: $Spayed_or_Neutered\n"
. "Vets_Name_Address: $Vets_Name_Address\n"
. "Pets_Birth_Date: $Pets_Birth_Date\n"
. "Last_Vacation_Date: $Last_Vacation_Date\n"
. "How_did_you_find_out_about_Smart_Dogs: $How_did_you_find_out_about_Smart_Dogs\n"
. "Special_Instructions: $Special_Instructions\n"
. "Terms_and_conditions_of_trade: $Terms_and_conditions_of_trade\n"
. "Disclaimer: $Disclaimer\n"
. "Promotion_code: $Promotion_code\n"
@mail$($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header);
//Sending auto respond Email to visitor
$pfw_header = "From: carl@smartdogs.co.nz\n";
. "Reply-To: carl@smartdogs.co.nz\n"
$pfw_subject = "Smart Dogs Registration";
$pfw_email_to = "$EmailFrom";
$pfw_message = "Dear $First_Name $Last_Name\n";
. "\n"
. "Thank you for joining Smart Dogs, your details will be processed as soon as possible. Normally within 24 hours after this we will call you, to arrange some extra happiness for your pet.\n"
. "\n"
. "If a dog eats your details and we don’t call you soon, please feel free to give us a call on 0800 436 422.\n"
. "\n"
. "Kind regards,\n"
. "Smart Dogs Team"
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header );
header("Location: registration_success.htm");
?>