and */ $thank_you_message = <<

We have received your message. If required, we'll get back to you as soon as possible.









EOD; /* URL to be redirected to after the form is submitted. If this is specified, then the above message will not be shown and user will be redirected to this page after the form is submitted */ /* Example: $thank_you_url = 'http://www.yourwebsite.com/thank_you.html'; */ $thank_you_url = ''; /******************************************************************************* * Do not change anything below, unless of course you know very well * what you are doing :) *******************************************************************************/ $label_name = 'Your Name'; $label_email = 'Your Email'; $label_subject = 'Please choose a subject'; $label_referer = 'Where did you hear about our site'; $label_message = 'Your comment'; $label_code = 'Code'; $name_value = ''; $email_value = ''; $subject_value = ''; $referer_value = ''; $message_value = ''; $label_name_empty_style = ''; $label_email_empty_style = ''; $label_email_invalid = ''; $label_subject_empty_style = ''; $label_referer_empty_style = ''; $label_message_empty_style = ''; $label_code_empty_style = ''; $label_code_invalid = ''; if (!isset($_POST['submit'])) { showForm(); } else { //form submitted $error = 0; if(!empty($_POST['name'])) { $name_value = clean_var($_POST['name']); if (function_exists('htmlspecialchars')) $name_value = htmlspecialchars($name_value, ENT_QUOTES); } else { $error = 1; $label_name_empty_style = 'color:#FF0000;'; } if(!empty($_POST['email'])) { $email_value = clean_var($_POST['email']); if (!ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $_POST['email'])) { $error = 1; $label_email_empty_style = 'color:#FF0000;'; $label_email_invalid = 'Invalid email'; } } else { $error = 1; $label_email_empty_style = 'color:#FF0000;'; } if(!empty($_POST['subject'])) { $subject_value = clean_var($_POST['subject']); if (function_exists('htmlspecialchars')) $subject_value = htmlspecialchars($subject_value, ENT_QUOTES); } else { $error = 1; $label_subject_empty_style = 'color:#FF0000;'; } if(!empty($_POST['referer'])) { $referer_value = clean_var($_POST['referer']); if (function_exists('htmlspecialchars')) $referer_value = htmlspecialchars($referer_value, ENT_QUOTES); } // else { // $error = 1; // $label_referer_empty_style = 'color:#FF0000;'; // } if(!empty($_POST['message'])) { $message_value = clean_var($_POST['message']); if (function_exists('htmlspecialchars')) $message_value = htmlspecialchars($message_value, ENT_QUOTES); } else { $error = 1; $label_message_empty_style = 'color:#FF0000;'; } if(empty($_POST['captcha_code'])) { $error = 1; $label_code_empty_style = 'color:#FF0000;'; } else { include_once "/gus/hup/addall/contact/securimage.php"; $securimage = new Securimage(); $valid = $securimage->check($_POST['captcha_code']); if(!$valid) { $error = 1; $label_code_empty_style = 'color:#FF0000;'; $label_code_invalid = 'Incorrect code'; } } if ($error == 1) { $error_message = 'Please correct/enter field(s) in red.'; showForm(); } else { if (function_exists('htmlspecialchars_decode')) $name_value = htmlspecialchars_decode($name_value, ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $subject_value = htmlspecialchars_decode($subject_value, ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $referer_value = htmlspecialchars_decode($referer_value, ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $message_value = htmlspecialchars_decode($message_value, ENT_QUOTES); $browser = $_SERVER['HTTP_USER_AGENT']; $ip=$_SERVER['REMOTE_ADDR']; $ip2 = $_SERVER['HTTP_X_FORWARDED_FOR']; $message = "Browser: $browser\nIP: $ip\nIP: $ip2\n\nReferer: $referer_value\nName: $name_value\nEmail: $email_value\n\n\nMessage:\n$message_value"; if (!$from) $from_value = $email_value; else $from_value = $from; $headers = "Reply-To: $email_value"; mail($to,"$subject_prefix - $subject_value", $message, $headers); if (!$thank_you_url) { include 'form-header.php'; echo $GLOBALS['thank_you_message']; echo "\n"; include 'form-footer.php'; } else { header("Location: $thank_you_url"); } } } //else submitted function showForm() { include 'form-header.php'; echo $GLOBALS['error_message']; echo <<

{$GLOBALS['label_email_invalid']}

CAPTCHA Image

{$GLOBALS['label_code_invalid']}

(Please enter the text in the image above. Text is not case sensitive.)
Click here if you cannot recognize the code.

All fields are required.

Every day we receive many e-mails addressing one of the following frequently answered questions, such as how to find a book, how to appraise the value of a book, how to sell a book. Please take a moment to check whether your question can be answered by our FAQ section. If not, we're happy to assist you individually. If yes, you can get your answer immediately, at the same time free up our time to assist other users with additional questions, or to improve this site consistently. We thank you for your consideration!

EOD; include 'form-footer.php'; } function clean_var($variable) { $variable = strip_tags(stripslashes(trim(rtrim($variable)))); return $variable; } ?>