Parašė bruzgis· 2008 Lie. 13 15:07:51
#8
Nu tai ir sukurkim mes ta special_id esamiems vartotojams:
atsidarom maincore.php
susirandam
if (isset($_POST['login'])) {
$user_pass = md5($_POST['user_pass']);
$user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($_POST['user_name']));
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$user_name' AND (user_password='".md5($user_pass)."' OR user_password='$user_pass')");
if (dbrows($result) != 0 && check_captcha($_POST['captcha_encode'],$_POST['captcha_code'])) {
$data = dbarray($result);
ir po juo pridedam si koda
if ($data['special_id'] == '') {
$spec_id = md5(microtime().sha1(mt_rand()+mt_rand(1,2)*time()));
$result = dbquery("UPDATE ".$db_prefix."users SET special_id='$spec_id' WHERE user_id='".$data['user_id']."'"); }