// parameters
$email_to = "sales@digitalvisionbd.com";
$email_from = "anonymous@digitalvisionbd.com";
$email_name = "DigitalVisionBD.com";
$msg_confirm = "Please review all of the informaion you have provided and click Submit once more to continue.\\n\\nTo make any changes at this point, please click the Edit button.";
$msg_thankyou = "Thank you. Your quotation request has been posted successfully. We will get in touch with you as soon as possible.";
$msg_error = "We are sorry. The following error(s) occured while trying to process your information:";
$msg_unknown_error = "An unknown error occured. Please try again later or contact us directly at $email_to with your project details for a quotation from us.";
$msg_cookie_error = "We are sorry. Your information cannot be processed without support for session cookies from your browser. Cookies are either disabled or not supported by your browser. Please configure your browser to accept cookies or contact us directly at $email_to with your project details for a quotation from us.";
// functions
if(function_exists('checkemail') == false)
{
function checkemail($email)
{
list($userName, $mailDomain) = split("@", $email);
if($_SERVER[SERVER_NAME] == "localhost")
return true;
if (checkdnsrr($mailDomain, "MX") && strlen($userName) > 0)
return true;
else return false;
}
}
// image verification codes
include "crypt.inc";
$rand = urlencode(encrypt(substr(str_shuffle("ABCDEFGHJKLMNPRTUVWXYZ234679"), 0, 5)));
$rand64 = base64_encode($rand);
// form processing and email codes
session_start();
$show_form = true;
$p_process = "yes";
if(strlen($_POST[process]) == 0)
{
foreach($_SESSION as $key=>$value)
unset($_SESSION[$key]);
session_regenerate_id(true);
}
else if($_POST[process] == "reset")
{
foreach($_SESSION as $key=>$value)
unset($_SESSION[$key]);
session_regenerate_id(true);
}
else if($_POST[process] == "yes")
{
foreach($_POST as $key=>$value)
$_SESSION["$key"] = $value;
extract($_SESSION, EXTR_OVERWRITE | EXTR_PREFIX_ALL, "p");
// input validation
$errors = array();
if(strlen($p_name) < 3)
array_push($errors, "Full Name too short or blank.");
if(!checkemail($p_email))
array_push($errors, "Your E-Mail Address too short, blank or invalid.");
if(strlen($p_country) == 0)
array_push($errors, "No Country selected.");
if(strlen($p_phone) < 7)
array_push($errors, "Phone Number is too short, blank or invalid.");
if(strlen($p_project_type) == "")
array_push($errors, "Desired Project Type not specified.");
if(strlen($p_completion_time) == "")
array_push($errors, "Project Completion Time not specified.");
if(strlen($p_page_count) == "")
array_push($errors, "Estimated Page Count not specified.");
if(strlen($p_budget_range) == "")
array_push($errors, "Budget Range not specified.");
if(strlen($p_features_required) < 10)
array_push($errors, "Nothing mentioned about the Features You Would Like To Have.");
if($p_security1 != decrypt(urldecode(base64_decode($p_security2))))
//array_push($errors, "Image Verification Code is blank or does not match with the original image.");
ob_start();
if(count($errors) > 0)
{
echo "$msg_error\\n\\n";
$errors = array_reverse($errors);
while($error = array_pop($errors))
echo " - $error\\n";
echo "\\nPlease remember to re-enter the Image Verification Code before submiting your information.";
$show_form = true;
}
else
{
echo "$msg_confirm";
$p_process = "confirm";
$show_form = false;
}
$response = '';
}
else if($_POST[process] == "edit")
{
extract($_SESSION, EXTR_OVERWRITE | EXTR_PREFIX_ALL, "p");
$show_form = true;
$p_process = "yes";
}
else if($_POST[process] == "confirm")
{
extract($_SESSION, EXTR_OVERWRITE | EXTR_PREFIX_ALL, "p");
$show_form = false;
$p_process = "confirm";
ob_start();
if(strlen($_SESSION[process]) <= 0)
echo $msg_cookie_error;
else
{
$fields = array(
"p_quotation_no" => "Quotation No.",
"p_name" => "Full Name",
"p_businessname" => "Business Name",
"p_email" => "E-mail Address",
"p_address" => "Address",
"p_country" => "Country",
"p_state" => "City/Province/State",
"p_postcode" => "Postal Code/Zip",
"p_phone" => "Phone",
"p_fax" => "Fax",
"p_project_type" => "Desired Project Type",
"p_current_link" => "Current Website Link",
"p_domain_required" => "Require Domain Name",
"p_hosting_required" => "Require Website Hosting",
"p_supply_source_material" => "Provide Source Material",
"p_completion_time" => "Project Completion Time",
"p_page_count" => "Estimated Page Count",
"p_budget_range" => "Budget Range",
"p_internet_knowledge" => "Internet Knowledge",
"p_features_required" => "Features To Have",
"p_additional_comments" => "Additional Comments",
);
$email_message = "
";
if(@mail($email_to, "Quotation Request [$quotation_no]", $email_message, "From: \"$p_name\" <$email_from>\r\nReply-to: \"$p_name\" <$p_email>\r\nContent-Type: text/html; charset=\"iso-8859-1\"\r\n"))
{
echo $msg_thankyou;
$email_message = "Hello $p_name,\r\n\r\nWe have received your request for a quotation. This is an automatic response to confirm you about the reception of your request. We will contact you soon with a quotation for your project.\r\n\r\nThank You.\r\n$email_name";
@mail("\"$p_name\" <$p_email>", "Re: Quotation Request [$quotation_no]", $email_message, "From: \"DigitalVisionBD.com\" <$email_to>");
}
else echo $msg_unknown_error;
$response = '';
}
}
?>
Web Design Company In USA, CANADA, INDIA, BANGLADESH - Digital Vision