VIDAK450

 
Контакты
E-Mail

| * Одноклассники * | ----------------------------------------------------------- | ICQ: 248932 | | E-mail: pavilion@epage.ru | ----------------------------------------------------------- | Copyright (c) 2009, Паутина.ат http://pautina.at | ----------------------------------------------------------- =========================================================== | * Данный код защищен авторскими правами * | =========================================================== */ $button = $_POST['send_f']; include("../options.php"); include("../functions.php"); if(!isset($button)) { header("location:$host/index.php"); exit; } else { $s = array(); for($i=0;$i<=17;$i++) { $s[$i] = new err; $s[$i]->flag = 0; $s[$i]->name = ""; } $s[0]->name = trim($_POST['schoolCountry']); $s[1]->name = trim($_POST['schoolRegion']); $s[2]->name = trim($_POST['schoolCity']); $s[3]->name = trim($_POST['schoolNum']); $s[4]->name = trim($_POST['schoolYear']); $s[5]->name = trim($_POST['schoolClass']); $s[6]->name = trim($_POST['name']); $s[7]->name = trim($_POST['family']); $s[8]->name = trim($_POST['sex']); $s[9]->name = trim($_POST['age_d']); $s[10]->name = trim($_POST['age_m']); $s[11]->name = trim($_POST['age_y']); $s[12]->name = trim($_POST['country']); $s[13]->name = trim($_POST['city']); $s[14]->name = strtolower(trim($_POST['email'])); $s[15]->name = trim($_POST['password']); $s[16]->name = trim($_POST['password1']); $s[17]->name = trim($_POST['protect']); $log = 0; // Проверка на наличие данных в полях for($i=0;$i<=17;$i++) { if(!isset($s[$i]->name) || $s[$i]->name == "" || $s[$i]->name == -1) { $s[$i]->flag = 1; $log = 1; } } $schoolCountry = $s[0]->name; $schoolRegion = $s[1]->name; $schoolCity = $s[2]->name; $schoolNum = $s[3]->name; $schoolYear = $s[4]->name; $schoolClass = $s[5]->name; $name = $s[6]->name; $family = $s[7]->name; $sex = $s[8]->name; $age_d = $s[9]->name; $age_m = $s[10]->name; $age_y = $s[11]->name; $country = $s[12]->name; $city = $s[13]->name; $email = $s[14]->name; $password = $s[15]->name; $password1 = $s[16]->name; $protect = $s[17]->name; session_start(); $protect1 = $_SESSION['PROTECT']; $_SESSION['S'] = $s; if($log == 1) {header("location:$host/reg/registration.php?idC=$schoolCountry&idR=$schoolRegion&idCi=$schoolCity&idS=$schoolNum&log=1");exit;} $ch0 = preg_match('/^[w]{1}[w.-_]*@[w]{1}[w-_.]*.[w]{2,4}$/i',$email); if($ch0 == 0) {header("location:$host/reg/registration.php?idC=$schoolCountry&idR=$schoolRegion&idCi=$schoolCity&idS=$schoolNum&log=5");exit;} include("../connect.php"); $query = "select id from $users where email='$email'"; $r = mysql_query($query) or die("Ошибка при подключении к базе данных"); $num = mysql_num_rows($r); if($num != 0) $log = 2; if($log == 2) {header("location:$host/reg/registration.php?idC=$schoolCountry&idR=$schoolRegion&idCi=$schoolCity&idS=$schoolNum&log=2");mysql_close();exit;} if($password != $password1) $log = 3; if($log == 3) {header("location:$host/reg/registration.php?idC=$schoolCountry&idR=$schoolRegion&idCi=$schoolCity&idS=$schoolNum&log=3");mysql_close();exit;} if($protect != $protect1) $log = 4; if($log == 4) {header("location:$host/reg/registration.php?idC=$schoolCountry&idR=$schoolRegion&idCi=$schoolCity&idS=$schoolNum&log=4");mysql_close();exit;} //$password = md5($password); if($age_m <10 ) $age = "$age_y"."-"."0"."$age_m"; else $age = "$age_y"."-"."$age_m"; if($age_d <10 ) $age = "$age"."-"."0"."$age_d"; else $age = "$age"."-"."$age_d"; $day = date("Y-m-d H:i:s"); $regTime = time(); $code = genCode(32); $query = "insert into $users set email='$email', password='$password', name='$name', family='$family', sex='$sex', age='$age', lastVisit='$day', country='$country', city='$city', regTime='$regTime', miPass='$code'"; $r = mysql_query($query) or die("Ошибка при подключении к базе данных"); $userId = mysql_insert_id(); $ste = $schoolYear - $schoolClass; $query = "insert into $school set userId='$userId', schoolYear='$schoolYear', schoolNum='$schoolNum', schoolClass='$schoolClass', schoolCountry='$schoolCountry', schoolRegion='$schoolRegion', schoolCity='$schoolCity', schoolYearIn='$ste'"; $r = mysql_query($query) or die("Ошибка при подключении к базе данных"); @mkdir("../photos/$userId"); $_SESSION['REG_OK'] = "OK"; $_SESSION['EMAIL_OK'] = $email; if(isset($s)) unset($s); if(isset($_SESSION['S'])) unset($_SESSION['S']); include("../mail/regMail.php"); mysql_close(); header("location:$host/reg/regComplete.php"); } ?>