|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-16 18:40 UTC] eusebiomarques at hotmail dot es
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 06:00:01 2025 UTC |
Description: ------------ the php can not asign the "date_1_fila_".$i in the _POST argument then i must to write a lot of code to do this Reproduce code: --------------- <?php if (isset($_GET['action']) && $_GET['action']=="save"){ for ($i=0;$i<10;$i++){ echo "post_1=".$_POST["date_1_fila_".$i]; $a="date_2_fila_".$i; echo "post_2=".$_POST[$a]; echo "post_3=".$_POST["date_3_fila_".$i]; } } ?> <form id="form1" name="form1" method="post" action="?action=save"> <label> <div align="center"><input type="submit" name="Submit" value="Salvar todas las rutas" /></div></label> </form> <br> <br> <?php for($i=0; $i<10; $i++) { ?> <input name="date_1_fila_<?php echo $i;?>" value="" type="text" class="textbox" size="10" /> <input name="date_2_fila_<?php echo $i;?>" value="" type="text" class="textbox" size="10" /> <input name="date_3_fila_<?php echo $i;?>" value="" type="text" class="textbox" size="10" /> <?php } ?> Expected result: ---------------- i spect the result the data in the text field the php can not asign the "date_1_fila_".$i in the _POST argument then i must to write a lot of code to do this Actual result: -------------- post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=post_1=post_2=post_3=