session_start(); $title = "Contact Us"; $introtext = "Contact us"; $site_url = "http://canopenstorecom.h1105258.serverkompetenz.net"; extract($_REQUEST, EXTR_SKIP); $PHP_SELF = $_SERVER['PHP_SELF']; $title = htmlentities(strip_tags(stripslashes($title))); $company = htmlentities(strip_tags(stripslashes($company))); $address = htmlentities(strip_tags(stripslashes($address))); $phone = htmlentities(strip_tags(stripslashes($phone))); $msgsubject = htmlentities(strip_tags(stripslashes($msgsubject))); $product = htmlentities(strip_tags(stripslashes($product))); $actcode = htmlentities(strip_tags(stripslashes($actcode))); $message = htmlentities(strip_tags(stripslashes($message))); $name = htmlentities(strip_tags(stripslashes($name))); $email = htmlentities(strip_tags(stripslashes($email))); $email2 = htmlentities(strip_tags(stripslashes($email2))); $captcha_code = htmlentities(strip_tags(stripslashes($captcha_code))); include(dirname(__FILE__)."/header.php"); include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php'; $securimage = new Securimage(); // address to send emails to $emailregular = "canopenstoresales@esacademy.com"; $errors = ""; if ($submitted) { if (validate_input()) { submit_input(); footer(); return; } } input(); footer(); return; function footer() { include(dirname(__FILE__)."/footer.php"); } function icon() { ?>
Thank you for contacting us!
Your information has been Emailed to us and you have been CC'ed on the Email. If you do not receive your copy within 12 hours or you do not hear back from us within three business days, then please contact us at canopenstoresales@esacademy.com.
} // returns "checked" if $value has the value $desired function check($value, $desired) { if ($value == $desired) return "checked"; return ""; } // returns "selected" if $value has the value $desired function select($value, $desired) { if ($value == $desired) return "selected"; return ""; } function input() { global $PHP_SELF; global $errors; global $name; global $title; global $company; global $address; global $email; global $email2; global $phone; global $msgsubject; global $product; global $actcode; global $message; ?>Please fill in the form below. * = required information.
if ($errors != "") { echo "$errors
"; } ?> } function validate_contactdetails() { global $errors; global $name; global $email; global $email2; global $securimage; $name = htmlentities(strip_tags(stripslashes($name))); $email = htmlentities(strip_tags(stripslashes($email))); $email2 = htmlentities(strip_tags(stripslashes($email2))); if ($name == "") { $errors = "Please enter your name."; return false; } if ($email == "") { $errors = "Please enter your email address."; return false; } if ($email != $email2) { $errors = "Please enter the same email address in both Email boxes."; return false; } if (preg_match('/\.ru$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in .ru. Please try another email address."; return false; } if (preg_match('/HardwareFan\.com$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in HardwareFan.com. Please try another email address."; return false; } if (preg_match('/\.su$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in .su. Please try another email address."; return false; } if (preg_match('/\.tuz$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in .tuz. Please try another email address."; return false; } if (preg_match('/\.rus$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in .rus. Please try another email address."; return false; } if (preg_match('/adverts\.com$/', $email)) { $errors = "Sorry, spammers are using email addresses ending in adverts.com. Please try another email address."; return false; } if ($securimage->check($_POST['captcha_code']) == false) { $errors = "Please enter the validation text."; return false; } return true; } function validate_input() { global $errors; global $title; global $company; global $address; global $phone; global $msgsubject; global $product; global $actcode; global $message; $title = htmlentities(strip_tags(stripslashes($title))); $company = htmlentities(strip_tags(stripslashes($company))); $address = htmlentities(strip_tags(stripslashes($address))); $phone = htmlentities(strip_tags(stripslashes($phone))); $msgsubject = htmlentities(strip_tags(stripslashes($msgsubject))); $product = htmlentities(strip_tags(stripslashes($product))); $actcode = htmlentities(strip_tags(stripslashes($actcode))); $message = htmlentities(strip_tags(stripslashes($message))); if (validate_contactdetails() == false) { return false; } return true; } function submit_input() { global $name; global $title; global $company; global $address; global $email; global $email2; global $phone; global $msgsubject; global $product; global $actcode; global $message; global $emailregular; global $emailsupport; $headers = "CC: $email\r\nFrom: sales@canopenstore.com (The CANopen Store)\r\nReply-to: $email\r\n"; $subject = "[The CANopen Store] $msgsubject"; $msg = "Name: $name\n"; $msg .= "Title: $title\n"; $msg .= "Company: $company\n"; $msg .= "Address:\n$address\n"; $msg .= "Email: $email\n"; $msg .= "Phone: $phone\n\n"; $msg .= "Product:\n$product\n"; $msg .= "Activation Code:\n$actcode\n"; $msg .= "Message:\n$message\n"; mail($emailregular, $subject, $msg, $headers); thanks(); } ?>