#46098 [Opn->Csd]: _Post canot asign a variable , only a fixed string
| From: | eusebiomarques at hotmail dot es | Date: | Tue, 16 Sep 2008 18:40:35 +0000 |
| Subject: | #46098 [Opn->Csd]: _Post canot asign a variable , only a fixed string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129028@lists.php.net to get a copy of this message | ||
ID: 46098
User updated by: eusebiomarques at hotmail dot es
Reported By: eusebiomarques at hotmail dot es
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: centos
PHP Version: 5.3.0alpha2
New Comment:
bad code
Previous Comments:
------------------------------------------------------------------------
[2008-09-16 18:15:29] eusebiomarques at hotmail dot es
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=
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46098&edit=1