During normal working hours we will be able to respond within 48 hours.
Please let ADL Software know about this problem!");
mysql_select_db($dbname, $chandle) or die ($dbname . " Unfortunatly the connection failed to our database. The database name could not be found. Please let ADL Software know about this problem! " . $dbuser);
$sql = "INSERT INTO ADLInspect_Question (Package,Question,ContactName,ContactBusiness,ContactEmail,ContactPhone) VALUES ('$package', '$question', '$contactName', '$businessName', '$emailAddress', '$telephoneNumber')";
$result = mysql_db_query($dbname, $sql);
//Send off the e-mails
//Get the to addresses from file
// // read the list of emails from the file.
// $email_list = file("elist.txt");
// // count how many emails there are.
// $total_emails = count($email_list);
// // go through the list and trim off the newline character.
// for ($counter=0; $counter<$total_emails; $counter++)
// {
// $email_list[$counter] = trim($email_list[$counter]);
// }
// // implode the list into a single variable, put commas in, apply as $to value.
// $to = implode(",",$email_list);
$to = "support@adlsoftware.com";
$subject = "ADL Inspect Question (from website)";
$body = stripslashes("Hello Question Response Team,\r\n\r\nI am asking a question about '$package'.\r\n\r\n\r\n$question\r\n\r\n\r\nFor more information please reply to this e-mail.\r\n\r\nName: $contactName\r\nBusiness Name: $businessName\r\nE-Mail Address: $emailAddress\r\nPhone: $telephoneNumber\r\n\r\nThank-you.");
$headers = 'From: ' . $contactName . ' <' . $emailAddress . '>\r\n';
if (mail($to, $subject,$body,$headers))
{
echo '
Thank-you for your question! A representative will be in contact with you within 48 working hours.
';
}
else
{
echo '
Unfortunatly and error occured while attempting to send your question via e-mail. If possible - please let ADL Software know about the problem by telephoning our support team.
';
}
}
function validate_form()
{
if ($_POST['Package'] == "< Please Select >")
{
$ListErrors["ErrorPackage"]="Please select a section";
};
if (strlen(trim($_POST['Question'])) == 0)
{
$ListErrors["ErrorQuestion"]="Please ask a question";
}
if (strlen(trim($_POST['ContactName'])) == 0)
{
$ListErrors["ErrorContactName"]="Please enter a contact name";
}
if (strlen(trim($_POST['BusinessName'])) == 0)
{
$ListErrors["ErrorBusinessName"]="Please enter a business name";
}
if (strlen(trim($_POST['EmailAddress'])) == 0)
{
$ListErrors["ErrorEmailAddress"]="Please enter an e-mail address";
}
else if (!is_email_valid(trim($_POST['EmailAddress'])))
{
$ListErrors["ErrorEmailAddress"]="Please enter a valid e-mail address";
}
if (strlen(trim($_POST['TelephoneNumber'])) == 0)
{
$ListErrors["ErrorTelephone"]="Please enter a telephone number";
}
return $ListErrors;
}
function is_email_valid($email)
{
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email);
}
?>