AndzX8-842 Posted February 1, 2006 Report Share Posted February 1, 2006 PHP skripts veic HTTP autorizāciju, izvelkot lietotāvārdus un paroles no mysql datu bāzes. Tik tālu viss ir kārtībā. Bet ir nepieciešams izvilkt datus vēlreiz, proti, lai nevis notiktu pārbaude vai lietotājs ar atbilstošu paroli eksistē, bet gan, lai dabūtu datus par to lietotāju, kas veiksmīgi ir ielogojies. Kods te - http://paste.php.lv/3234. MySQL izdod šādu ķļūdu paziņojumu. Warning: mysql_result() [function.mysql-result]: Unable to jump to row 3 on MySQL result index 8 in V:\Core\htdocs\ur.php on line 39 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 3 on MySQL result index 8 in V:\Core\htdocs\ur.php on line 40 Droši vien ir kaut kas, ko es nezinu par PHP un tāpēc arī īsti nedarbojas skripts, bet man liekas, ka problēmu izraisa šī rindiņa(?). $_user=$_SERVER['PHP_AUTH_USER']; Link to comment Share on other sites More sharing options...
Delfins Posted February 1, 2006 Report Share Posted February 1, 2006 (edited) wtf,.. līki uz visiem 360 grādiem... $query="SELECT * FROM users"; $result=mysql_query($query) or die(); $num=mysql_numrows($result) or die(); mysql_close(); $i=0; while ( $i < $num ) { $ip_check=mysql_result($result,$i,"ip"); $username_check=mysql_result($result,$i,"username"); $userpassword_check=mysql_result($result,$i,"password"); $users["$username_check"] = "$userpassword_check"; $i++; } paņem gatavu kodu no kādas lapeles un nemocies... vai ari cheko ... select * from users where username = $_SERVER['PHP_AUTH_USER'] AND password = md5($_SERVER['PHP_AUTH_PW']) Edited February 1, 2006 by Delfins Link to comment Share on other sites More sharing options...
AndzX8-842 Posted February 1, 2006 Author Report Share Posted February 1, 2006 Faktiski tie ir divi gatavi kodi no lapelēm, ko paņēmu un saliku kopā. Bet diezko nestrādā :>. Link to comment Share on other sites More sharing options...
Delfins Posted February 1, 2006 Report Share Posted February 1, 2006 mueh... man trūkst vārdu... Tu vismaz papētīji ko kopē... Link to comment Share on other sites More sharing options...
Recommended Posts