session_start(); switch ($_GET['lang']) { case "bg": require("mailform2_lang_bg.php"); break; case "en": require("mailform2_lang_en.php"); break; default: require("mailform2_lang_bg.php"); break; } function sanitize($x) { return str_replace(array('..', '\ ', '\\', '/', ':', '*', '?', '"', "'", '<', '>', '|'), "", $x); } $mailform['recipient'] = "ksdltd2008@gmail.com"; $mailform['subject'] = $LANG['mailform-subject']; $mailform['exploits'] = "/(content-type|bcc:|cc:|document.cookie|onclick|onload)/i"; foreach ($_POST as $key => $val) { $mailform['POST'][$key] = trim(stripslashes(strip_tags($val))); if (preg_match($mailform['exploits'], $val)) { exit(":)"); } } if (isset($mailform['POST']['submit'])) { if ($_SESSION['captcha_code'] == $_POST['captcha_code'] && !empty($_SESSION['captcha_code'])) { unset($_SESSION['captcha_code']); /*if (empty($mailform['POST']['name']) || empty($mailform['POST']['descr']) || empty($mailform['POST']['contacts']) || empty($mailform['POST']['email'])) { $err = $LANG['mailform-required']; require("mailform2_table.php"); exit(); } else */if ($mailform['POST']['email'] && !ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", strtolower($mailform['POST']['email']))) { $err = $LANG['mailform-not-valid-mail']; require("mailform2_table.php"); exit(); } else { $mailform['message'] = "