Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 paskaidrošu. Piemēram reģistrācijas forma. login; password; tiklīk ir savadīts viss, spiež reģistrēties. un tos datus viņš aiznes uz DB Bet es gribu lai viņš nevis aiznes uz db bet noteiktajā vietā uz array. ir iespējams, jeb tikai caur db? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Tie dati jau pašā sākumā ir ieks masīva un tas, parasti, ir vai nu $_POST vai nu $_GET masīvs. Pamati! Quote Link to comment Share on other sites More sharing options...
briedis Posted November 17, 2011 Report Share Posted November 17, 2011 .. un tas array glabājas KUR? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Nu kā... pēc formas submitošanas, atkarībā no <form> taga method atribūta, tiks izveidots masīvs $_POST (ja 'post') vai $_GET (ja 'get'). Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 (edited) <?php $db = new db('localhost', 'user', 'pw', 'db'); $users = array(array('loginu nolasa no tā, kur ievadu loginu', 'paroli nolasa no tā, kur ievadu paroli'),); ?> <form method="post"> <table class="signup" cellspacing="0" cellpadding="0"> <tr><td align="right">logins:</td><td><input type="text" name="logins, ko ievadu sheit"></td></tr> <tr><td align="right">parole</td><td><input type="text" name="parole ko ievadu sheit"></td></tr> </table> <center style='margin-top:10px;'><input type="submit" name="login" value="Ienākt"></center> </form> <br /><br /><br /> Skaidrāk vairs nevaru izteikties. Tātad, kā to dabūt gatavu? Edited November 17, 2011 by Blink Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 (edited) Vēlviens jautājums, ja es gribu no db pēdējo 1 ierakstu ievietot iekš array. Kā man to izdarīt? $users = array(array('no viena kollumma pēdējais ieraksts', 'no otra kollumma pēdējais ieraksts'),); kkā šitā? $login = $row['login']; $parole = $row['parole']; $db = new db('localhost', 'user', 'pw', 'db'); $users = array(array('login'=>$login,'parole'=>$parole,),); Edited November 17, 2011 by Blink Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted November 17, 2011 Report Share Posted November 17, 2011 $array = eval(base64_decode($_GET['a'])); ? Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 $array = eval(base64_decode($_GET['a'])); ? vari paskaidrot? Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 sataisiju paldies. :D $users = array(array($epasts, $parole,),); atrisinājums :D Quote Link to comment Share on other sites More sharing options...
Kemito Posted November 18, 2011 Report Share Posted November 18, 2011 v3rb0 - Aizmirsti tādu lietu kā eval(); kā arī nesaskatu šim vajadzību īsti :D Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 19, 2011 Report Share Posted November 19, 2011 Kemi, tas bija joks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.