Ñâåðíóòûé òåêñò
PHP |
<?php |
Êàêèå â í¸ì ñóùåñòâóþò óÿçâèìîñòè è ÷òî ñ ïîìîùüþ èõ ìîæíî ñäåëàòü? æåëàòåëüíî â ïðèìåðàõ òèïà:
Ñòðîêà:
PHP |
<?php |
PHP |
$res = mysql_query("SELECT `id` FROM `users` WHERE `login` = '$_POST['login']'"); |
PHP |
$reg_login = $var = isset($_POST['login'])?$_POST['login']:NULL; |
PHP |
if($_POST['action']=='register') |
PHP |
<input type="submit" value="'. $locale['reg_07'] .'" name='register'></td>; |
PHP |
if(isset($_POST['register'])){ ... } |
SQL |
/* User existance check */ $c_query = mysql_query("SELECT `id` FROM `users` WHERE `login` = '". mysql_real_escape_string($reg_login) ."'"); $c_result = mysql_num_rows($c_query); if($c_result > 0) { $err[] = $locale['reg_err_02']; } /* User IP existance check */ $c2_query = mysql_query("SELECT `id` FROM `users` WHERE `ip` = '". $userip ."'"); $c2_result = mysql_num_rows($c2_query); if($c2_result > 0) { $err[] = $locale['reg_err_03']; } |
SQL |
AND |
SQL |
"SELECT `id` FROM `users` WHERE ip ='127.0.0.1' AND name='dezigo'"; |
SQL |
('". $l ."','". $p ."','". $n ."','". $e ."',NOW(),'". $userip ."' |
PHP |
'$a','$b','$c' |
PHP |
" ' $a ' "," ' $b ' ", |
Öèòàòà |
ñîâåò:ëó÷øå ïèñàòü |
PHP |
$p = mysql_real_escape_string($pwd); |
Öèòàòà |
$pwd = md5($reg_passw1); |
Öèòàòà |
2. Ïðîâåðêà íà îáðàáîòêó ip? íåïîíÿòíî ÷òî âëçîìùèê ñìîæåò ñäåëàòü ñî ñâîèì ip ÷òîá íàíåñòè êàêîé ëèáî âðåä ñàéòó |
Öèòàòà |
4. Õì ó ìåíÿ íàïðèìåð åñòü ìûëî â mail[ru] òèïà xf_@mail[ru] |
Öèòàòà (twin @ 3.11.2009 - 10:38) | ||
|