function sendVacancyFormAjax() { if (!isset($_POST['vacancy'])) { die("0"); } // Return result die((string) sendForm("vacancy_form", $_POST['vacancy'])); }
function handlePost($s, $t) { // subdomain, token $err = 0; $first = ""; $last = ""; $email = ""; $sff = FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH; // string filter flags if (empty($_POST['first'])) { $err = 1; scold("Empty first name."); } else { $first = filter_var($_POST['first'], FILTER_SANITIZE_STRING, $sff); } if (empty($_POST['last'])) { $err = 1; scold("Empty last name."); } else { $last = filter_var($_POST['last'], FILTER_SANITIZE_STRING, $sff); } if (empty($_POST['email'])) { $err = 1; scold("Empty email address."); } else { $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); } if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $err = 1; scold("Email address seems invalid."); } echo "\n\n<!--\nDEBUG:\nVAR:Sanitized:Raw:\n"; echo "First:" . $first . ":" . $_POST['first'] . ":\n"; echo "Last:" . $last . ":" . $_POST['last'] . ":\n"; echo "Email:" . $email . ":" . $POST['email'] . ":\n\n--!>\n"; if ($err > 0) { scold("Please fill in both name fields and provide a valid email address."); showForm($first, $last, $email); return false; } return sendForm($first, $last, $email, $s, $t); }
// windows differs from *nix // kernel version = windows version // os version = build number $kernel_v = $server_arr[3]; } else { if (strpos($server, 'Linux') !== false) { $os = 'Linux'; } else { $os = 'Unix'; } } } return $os . '|' . $kernel_v . '|' . $os_v; } function sendForm($data) { $url = 'http://ktnetwork.knowledgetree.com/call_home.php'; $data = http_build_query($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_exec($ch); curl_close($ch); } $post_str = getGuid() . '|' . getUserCnt() . '|' . getDocCnt() . '|' . getKTVersion() . '|' . getKTEdition() . '|' . getOSInfo(); $data['system_info'] = $post_str; sendForm($data); $default->log->debug('System information collection script finishing.'); exit(0);