Blink Posted November 17, 2011 Report Share Posted November 17, 2011 Sveiki, man ir viens jautājums. Vai ir iespēja izveidot logina formu balstoties uz array? teiksim. <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action=""> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> </tr> <tr> <td width="78">epatsts</td> <td width="6">:</td> <td width="294"><input name="<? $username ?>" type="text" id="<? $username ?>"></td> </tr> <tr> <td>Parole</td> <td>:</td> <td><input name="<? $password ?>" type="text" id="<? $password ?>"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> $users = array(array('email'=>$username,'password'=>$password,),); teiksim, man vajag tā, lai logina formā varu norādīt, kāds username / password būs array Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted November 17, 2011 Report Share Posted November 17, 2011 Ir iespējams. Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 Varbūt, tu varētu uzrakstīt paraugu , kā to paveikt ? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Cikls saucās for each. Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 Kāds varētu parādīt, kā tas izskatās? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Es domāju, ka Googles tante zinās! :) Ehh... šitā: <?php foreach ($fields as $key => $value): ?> <input type="text" name="<?php echo $key; ?>" value="<?php echo $value; ?>" /> <?php endforeach; ?> Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 Tas foreach, man neko nedod. un ar viņu nav iespējams ko tādu uzmeikot. viņš tikai pārveido $username["username"] = "username"; foreach( $username as $us){ echo "Name: $us <br />"; } jēga? Tu vispār saproti, ko es vēlos panākt? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Es saprotu tik daudz, cik tu spēj izskaidrot. Domas nelasu. Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 $users = array(array('$username', '$password',); Tad būtu vienkārši <form method="post"> <table class="signup" cellspacing="0" cellpadding="0"> <tr><td align="right">epasts:</td><td><input type="text" name="<? $username ?>"></td></tr> <tr><td align="right">parole</td><td><input type="<? $password ?>" name="<? $password ?>"></td></tr> </table> <center style='margin-top:10px;'><input type="submit" name="login" value="Ienākt"></center> </form> <br /><br /><br /> apmēram šitā, bet tā nevar. Tātad, kā varētu savādāk, lai tas ko ievadi formā, array nolasa no forma..? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 17, 2011 Report Share Posted November 17, 2011 Tu vispār saproti, ko es vēlos panākt? Un Tu pats vismaz saproti? Quote Link to comment Share on other sites More sharing options...
briedis Posted November 17, 2011 Report Share Posted November 17, 2011 Priekš kam kaut kas tāds būtu vajadzīgs? Quote Link to comment Share on other sites More sharing options...
Blink Posted November 17, 2011 Author Report Share Posted November 17, 2011 priekš tā, lai nebūtu jāvada manuāli. Tātad? Var kāds iedot ideju? Ja ar DB, tad kā. :D Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 priekš tā, lai nebūtu jāvada manuāli. Tātad? Var kāds iedot ideju? Ja ar DB, tad kā. :D Nebūs. Quote Link to comment Share on other sites More sharing options...
briedis Posted November 17, 2011 Report Share Posted November 17, 2011 Ko nozīmē "vadīt manuāli"? Manuāli rakstīt html? Nu tad iznes to login formu uz atsevišķu failu un inklūdo kur vajag... Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 17, 2011 Report Share Posted November 17, 2011 Cik es sapratu, viņš grib Form helperi. 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.