фигня (

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if($_POST['register']){
extract($_POST,EXTR_PREFIX_ALL,"register");
$salt = md5(rand(0,999999).$register_mail);
$register = $db->prepare("insert into users (id,name,name2,name3,birth,gender,mail,country,adres,index,city,phone,metro,sn,so,snw,pass,salt) values ('',:name,:name2,:name3,:birth,:gender,:mail,:country,:adres,:index,:city,:phone,:metro,:sn,:so,:snw,:pass,:salt)");
$register->bindParam(':name', htmlentities(trim($register_name)), PDO::PARAM_STR);
$register->bindParam(':name2', htmlentities(trim($register_name2)), PDO::PARAM_STR);
$register->bindParam(':name3', htmlentities(trim($register_name3)), PDO::PARAM_STR);
$register->bindParam(':birth', $register_y."-".$register_m."-".$register_d, PDO::PARAM_STR);
$register->bindParam(':gender', $register_gender, PDO::PARAM_STR);
$register->bindParam(':mail', htmlentities(trim($register_mail)), PDO::PARAM_STR);
$register->bindParam(':country', $register_country, PDO::PARAM_STR);
$register->bindParam(':adres', htmlentities(trim($register_adres)), PDO::PARAM_STR);
$register->bindParam(':index', htmlentities(trim($register_index)), PDO::PARAM_INT);
$register->bindParam(':city', htmlentities(trim($register_city)), PDO::PARAM_STR);
$register->bindParam(':phone', htmlentities(trim($register_phone)), PDO::PARAM_STR);
$register->bindParam(':metro', htmlentities(trim($register_metro)), PDO::PARAM_STR);
$register->bindParam(':sn', $register_sn, PDO::PARAM_INT);
$register->bindParam(':so', $register_so, PDO::PARAM_INT);
$register->bindParam(':snw', $register_snw, PDO::PARAM_INT);
$register->bindParam(':pass', sha1(trim($register_pass).$salt), PDO::PARAM_STR);
$register->bindParam(':salt', $salt, PDO::PARAM_STR);
$register->execute();
}