php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46098 _Post canot asign a variable , only a fixed string
Submitted: 2008-09-16 18:15 UTC Modified: 2008-09-16 18:40 UTC
From: eusebiomarques at hotmail dot es Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.3.0alpha2 OS: centos
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eusebiomarques at hotmail dot es
New email:
PHP Version: OS:

 

 [2008-09-16 18:15 UTC] 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=




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-16 18:40 UTC] eusebiomarques at hotmail dot es
bad code
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC