1 ? 1 : 0; $reg_sex = $_POST['sex'] == 2 ? 'm' : 'zh'; $password = passgen(8); $pass = md5(md5($password)); $reg_name = $_POST['imname']; $live = $_POST['live']; $reg_nick2 = $user['nickname']; $reg_nick = $_POST['nick']; $abaut = $_POST['abaut']; $email = $_POST['email']; $dmy = $_POST['dmy']; $photo = $_POST['photo']; if (isset($_POST['submit']) && $_SESSION['access_token'] == $_POST['token_reg']) { // Определяем день рождение if (!empty($dmy)) { $ardr = explode('.', $dmy); if (sizeof($ardr)==3) { list($dayb, $monthb, $yearofbirth) = explode('.', $dmy); } elseif(sizeof($ardr)==3) { list($dayb, $monthb) = explode('.', $dmy); } else { list($dayb, $monthb, $yearofbirth) = explode('.', date('d.m.Y')); } } $sql_r = mysql_query("INSERT INTO `users` SET `name` = '" . mysql_real_escape_string($reg_nick) . "', `name_lat` = '" . mysql_real_escape_string(functions::rus_lat(mb_strtolower($reg_nick))) . "', `password` = '" . mysql_real_escape_string($pass) . "', `imname` = '" . mysql_real_escape_string($reg_name) . "', `about` = '" . mysql_real_escape_string($abaut) . "', `sex` = '$reg_sex', `live` = '" . mysql_real_escape_string($live) . "', `mail` = '" . mysql_real_escape_string($email) . "', `rights` = '0', `ip` = '" . core::$ip . "', `ip_via_proxy` = '" . core::$ip_via_proxy . "', `browser` = '" . mysql_real_escape_string($agn) . "', `datereg` = '" . time() . "', `lastdate` = '" . time() . "', `sestime` = '" . time() . "', `preg` = '$preg', `dayb` = '" . intval($dayb) . "', `monthb` = '" . intval($monthb) . "', `yearofbirth` = '" . intval($yearofbirth) . "'"); if ($sql_r) { $usid = mysql_insert_id(); echo '
'; require('../incfiles/end.php'); exit; } } if(count($user) > '1') { $token = mt_rand(1000, 100000); $_SESSION['access_token'] = $token; echo '