Jump to content
php.lv forumi

logins


Blink

Recommended Posts

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

Link to comment
Share on other sites

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; ?>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

$users = array(array('$username', '$password'blink3.gif,);

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..?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...