Welcome $rhost

"; $welcome .= "

This form should be used by our customers and professionals interested to leran more about our products and services.

"; } $emailerr = ''; $log_file = "/var/tmp/contact-page.log"; $tz = "America/New_York"; date_default_timezone_set($tz); $datestr = date('r'); $response = FALSE; function response() { print << Thank you for e-mailing Sutra. EOT; return; } $emailpattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD'; //echo "
";
//print_r($_POST);
//echo "
"; if (isset($_POST["from"])) { #if ((preg_match($emailpattern, $_POST['from']) === 1) && (strpos($_POST['from'],'@airkiosk')=== FALSE)) { if ((preg_match($emailpattern, $_POST['from']) === 1)) { // emailaddress is valid $response = TRUE; } else { $emailerr .= '

ERROR: The supplied e-mail address is not a valid address. Please check the e-mail address and try again. Thank you for your interest.

'; } } if (isset($_POST['security_code']) && isset($_SESSION['security_code'])) { # Vukasin 8.jan.2013. if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code']))) { # Vukasin 8.jan.2013. $response = TRUE; }else { $emailerr .= '

ERROR: The text you entered does not match the security image you saw. Please try again.

'; $response = FALSE; } }else{ // print 'The text you entered does not match the security image you saw. Please try again.

'; $response = FALSE; } // reCaptcha authentication by Vukasin //if (isset($_POST["recaptcha_response_field"])) { //require_once('recaptchalib.php'); // $privatekey = "6LeWJ-USAAAAAGVSUxz8avf-qxA29BIYpW_HEwbi"; // $resp = recaptcha_check_answer ($privatekey, // $_SERVER["REMOTE_ADDR"], // $_POST["recaptcha_challenge_field"], // $_POST["recaptcha_response_field"]); // // if (!$resp->is_valid) { // // What happens when the CAPTCHA was entered incorrectly // $emailerr .= '

ERROR: The reCAPTCHA was not entered correctly. Go back and// try it again.' . "(reCAPTCHA said: " . $resp->error . ')

'; // $response = FALSE; // } else { // if ($response == TRUE) {$response = TRUE;} // } //} if ($response) { # response $x = ($_POST['reservations'] == 'yes') ? 'yes' : 'no'; $y = ''; if ($_POST['hear'] == 'colleague') { $y = 'a colleague or another airline'; } else if ($_POST['hear'] == 'search') { $y = 'search engine'; } else { $y = 'something else'; } $body = "Name: ".$_POST['name']."\n" ."Title: ".$_POST['title']."\n" ."Company: ".$_POST['company']."\n" ."Website: ".$_POST['webaddr']."\n" ."Remote host: ".$rhost."\n" ."Do they have a reservations system? $x.\n" ."How did they hear about Sutra? $y.\n\n" ."reCaptcha checked OK \n\n" .$_POST['body']; $to = 'sutra@airkiosk.com,niketic@airkiosk.com,nn@airkiosk.com'; //$to = 'vukasin@airkiosk.com'; $from = $_POST['from']; $subject = 'CustomerEnquiry - '.$_POST['subject']; $hlog = fopen($log_file, 'a'); fwrite($hlog, "STARTMAIL::${datestr}::${from}\n$body\nENDMAIL::${datestr}::${from}\n"); fclose($hlog); $message = fopen("/airkiosk/AKK/log/tmp/$session.mail", 'w'); fwrite($message, "$body\n"); fclose($message); $r = array(); #exec("/var/www/cgi-bin/ak/newmail $to $from $subject $body", $r); #$p = popen("/var/www/cgi-bin/ak/newmail $to $from $subject $body", 'w'); #fwrite($p, $body); #pclose($p); $headers = "From: $from"; # ini_set('display_errors',1); #$test_email = mail("kindt@airkiosk.com","Test subject","Test body"); # mail($to, $subject, $body, $headers); $datastring = shell_exec("/var/www/cgi-bin/mail-contact $session \"$from\" \"$to\" \"$subject\""); # if($test_email){ # echo "Test success"; # }else{ # echo "Test failed."; # } response(); /* $_ENV['PRINT'] = 'no'; #Read in the page this one is embedded in $r = array(); exec("php -f /var/www/html/contact.php", $r); #Don't print headers $r[0] = ''; $r[1] = ''; foreach ($r as $val) { if (strpos($val, '') !== FALSE) { response(); } else { print "$val\n"; } } */ } else { if ($rhost) { mail('sutra@airkiosk.com,niketic@airkiosk.com,nn@airkiosk.com', "CustomerEnquiry - form requested by ${_SERVER['REMOTE_ADDR']}", "Remote host: $rhost"); } $hlog = fopen($log_file, 'a'); fwrite($hlog, "FORMACCESS::${datestr}::" . $_SERVER['REMOTE_ADDR'] . "\n"); fclose($hlog); # # # #Mailer Form # # # # //require_once('recaptchalib.php'); //$publickey = "6LeWJ-USAAAAABx-2ws2dS-agHFcSTN2UEi2c8y9"; //$displayrecaptcha = recaptcha_get_html($publickey); $name = ""; //isset() $name = isset($_POST['name']) ? $_POST['name'] : ''; //empty() $name = !empty($_POST['name']) ? $_POST['name'] : ''; $title = ""; //isset() $title = isset($_POST['title']) ? $_POST['title'] : ''; //empty() $title = !empty($_POST['title']) ? $_POST['title'] : ''; $from = ""; //isset() $from = isset($_POST['from']) ? $_POST['from'] : ''; //empty() $from = !empty($_POST['from']) ? $_POST['from'] : ''; $company = ""; //isset() $company = isset($_POST['company']) ? $_POST['company'] : ''; //empty() $company = !empty($_POST['company']) ? $_POST['company'] : ''; $webaddr = ""; //isset() $webaddr = isset($_POST['webaddr']) ? $_POST['webaddr'] : ''; //empty() $webaddr = !empty($_POST['webaddr']) ? $_POST['webaddr'] : ''; $subject = ""; //isset() $subject = isset($_POST['subject']) ? $_POST['subject'] : ''; //empty() $subject = !empty($_POST['subject']) ? $_POST['subject'] : ''; $body = ""; //isset() $body = isset($_POST['body']) ? $_POST['body'] : ''; //empty() $body = !empty($_POST['body']) ? $_POST['body'] : ''; print <<
$welcome $emailerr
Your Name:
Title:
Email address:
Company name:
Company website:
Do you currently have a reservations system?
Yes
No
How did you hear about the AirKiosk system?
Another airline/Colleague
Search engine
Other
Subject:
Message:

Security Image Text:
EOT; # # } ?>