airbus Posted January 30, 2009 Report Share Posted January 30, 2009 neesmu tads pro webos bet kas pirms mysql_query() ? Link to comment Share on other sites More sharing options...
Aleksejs Posted January 30, 2009 Report Share Posted January 30, 2009 Lai kaut ko nolasītu vai ierakstītu datu bāzē ir jāizdara šādas lietas: jāpieslēdzas datu bāzei - MySQL gadījumā mysql_connect vai mysqli_connect un mysql_select_db vai mysqli_select_db jāizveido vaicājums - Es iesaku vispirms ierakstīt mainīgajā, kuru pie nepieciešamības vari izdrukāt uz ekrāna (skat mana rakstītā par atkļūdošanu 3. punktu) jāizpilda vaicājums - mysql_query vai mysqli_query jāatslēdzas no datu bāzes - mysql_close vai mysqli_close Vai vispār esi kaut ko lasījis par web izstrādi ar PHP un MySQL? Link to comment Share on other sites More sharing options...
kechums Posted January 30, 2009 Report Share Posted January 30, 2009 To airbus: Tu maz to kodu papētiji, vai tad neredzi mysql_query rindu? Pieliec mysql_connect("localhost", "dblietotajs", "dbparole"); Aleksejs, tavas norādes priekš viņa būs pārlieku gudri uzrakstītas, visam taču jābūt noliktam uz paplātes... Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 Visulaik rāda ''No database selected'' Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2009 Report Share Posted February 1, 2009 jāpieslēdzas datu bāzei - MySQL gadījumā mysql_connect vai mysqli_connect un mysql_select_db vai mysqli_select_db http://www.homeandlearn.co.uk/php/php13p1.html Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 Paldies tas tgd izdevās bet kad mēģinu ielogoties mani aizmet uz to foruma lapu un izmet ''You must enter a username'' Vaina formā?? <form action='http://cs.ipsc.lv/f/index.php?act=Login&CODE=01' method='post' name='theform'> <div align="left"><font size="1" face="Arial, Helvetica, sans-serif">Username <input type='username' class='text' name='username'> <br> Password</font> <input type='password' class='text' name='password'> <br> <input name="submit" type='submit' class='submit' value='Login'> </div> </form> Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2009 Report Share Posted February 1, 2009 Ieliec index.php apskatei. Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 (edited) Kautvai esmu ielogojies forumā sakumlapā tāpat nerāda. Ir jau ielikts.. Kopumā tas izskatās apmēram šadi.. <center><h1>Autorizācija</h1></center> <?php mysql_connect("localhost", "root", "parole"); mysql_select_db("_web_5d5xy2"); if(isset($_COOKIE['member_id'])){ $get=mysql_query("SELECT * FROM `ibf_members` WHERE id='".intval($_COOKIE['member_id'])."'") or die(mysql_error()); $udata=mysql_fetch_object($get); if($udata->member_login_key==$_COOKIE['pass_hash']) { //izvadam kko shaadu: echo "Cau ".$udata->members_display_name.""; }else{ echo "tu neesi autorizeets"; //izvadam logina paneli } }else{ echo "tu neesi autorizeets"; } ?> <form action='http://cs.ipsc.lv/f/index.php?act=Login&CODE=01' method='post' name='theform'> <div align="left"><font size="1" face="Arial, Helvetica, sans-serif">Username <input type='username' class='text' name='username'> <br> Password</font> <input type='password' class='text' name='password'> <br> <input name="submit" type='submit' class='submit' value='Login'> </div> </form> Edited February 1, 2009 by ashais13 Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2009 Report Share Posted February 1, 2009 Vai šis index.php ir tas pats index.php uz kuru forma sūta datus (http://cs.ipsc.lv/f/index.php)? Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 Šis ir lapas index.php, bet kāds viņam sakars ar foruma indexu? Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2009 Report Share Posted February 1, 2009 Nezinu, kāds sakars (tas būtu Tev jāzina ;) ), bet 73. rindiņa Tev ir šāda: <form method="post" action="http://cs.ipsc.lv/f/index.php?act=Login&CODE=01" name="LOGIN"> Tātad, ja pareizi saprotu, tad viss tiek sūtīts uz foruma.index.php lapu un nevis uz šo, kura (, ja mana kristāla bumba ir pareizi uzķērusi ētera vibrācijas) atrodas http://cs.ipsc.lv/index.php. Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 Nu jā tā login forma man darbojas Bet katvai ielogjos man virs login formas rāda tu neesi autorizeets Un nerāda ''Cau Tiger'' vai kko tml.. Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2009 Report Share Posted February 1, 2009 Parādi kaut vienu vietu savā kodā, kurā Tu izmantotu no formas nosūtītos laukus UserName un PassWord. Kur ir tā vieta? Link to comment Share on other sites More sharing options...
ashais13 Posted February 1, 2009 Author Report Share Posted February 1, 2009 (edited) Esmu ielogojies Rāda "Sveiks Tiger" Viss ir tā kā vaig vienīgais rāda to login formu zem tā uzraksta.. Edited February 1, 2009 by ashais13 Link to comment Share on other sites More sharing options...
ashais13 Posted February 2, 2009 Author Report Share Posted February 2, 2009 Itkā viss iet bet tikai tā login forma jo es to html nevarēju ielikt echo"šeit" Tad nu rajājos pa netu meklēju pamācību kā login formu uztaisīt uz php, itkā 1 pamācību atradu This.. Bet kautkas nesanāk.. Link to comment Share on other sites More sharing options...
Recommended Posts