#21441 [Csd]: POST-ed array repeats itself
| From: | szabo_a at interware dot hu | Date: | Tue, 21 Jan 2003 09:01:07 +0000 |
| Subject: | #21441 [Csd]: POST-ed array repeats itself | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30799@lists.php.net to get a copy of this message | ||
ID: 21441
User updated by: szabo_a@interware.hu
Reported By: szabo_a@interware.hu
Status: Closed
Bug Type: Apache2 related
Operating System: RH 8.0 Apache 2.0
PHP Version: 4.2.2
New Comment:
The problem is that since then I upgraded to the latest CVS version
(4.3.1-dev), and the problem still exists:
Example:
http://www.parbanszep.hu/aa.php
Enter some text and submit. You will see what comes back. And the php
source is:
<html>
<body>
<form method="post">
<input type="text" name="xx" value="<?=$xx?>">
<input type="submit">
</form>
</body>
</html>
If I use GET instead of POST it seams to be OK. So this is not an
array, but rather a POST related bug.
Further info:
http://www.parbanszep.hu/info.php
Previous Comments:
------------------------------------------------------------------------
[2003-01-21 02:50:22] seper@interia.pl
i use the current releas version -> 4.3.0 on redhat-8.0 with apache
2.0.43 and get the same error.
-
<input name=\"szuk\" type=\"text\" id=\"szuk\">
-
input string>tralalala
$HTTP_POST_VARS['szuk'] tralalalaszuk=tralalalala
------------------------------------------------------------------------
[2003-01-06 12:11:11] white@blutkonserver.de
Hi,
i use the current releas version -> 4.3.0 on redhat-8.0 with apache
2.0.43 and get the same error.
here is another example
<?php
echo "<pre>\$_POST ";
print_r($_POST);
echo "\n\$_GET ";
print_r($_GET);
echo "</pre>";
?>
<hr>
<form name="frmTest" action="<?php echo $_SERVER['PHP_SELF'];
?>"
method="POST">
<input type="checkbox" name="chkTest[]" value="chbox 1">chbox
1<br />
<input type="checkbox" name="chkTest[]" value="chbox 2">chbox
2<br />
<input type="checkbox" name="chkTest[]" value="chbox 3">chbox
3<br />
<input type="checkbox" name="chkTest[]" value="chbox 4">chbox
4<br />
<input type="checkbox" name="chkTest[]" value="chbox 5">chbox
5<br
/><br />
<input type="submit" name="submit" value="submit">
</form>
output (all checkboxes selected):
$_POST Array
(
[chkTest] => Array
(
[0] => chbox 1
[1] => chbox 2
[2] => chbox 3
[3] => chbox 4
[4] => chbox 5
[5] => chbox 2
[6] => chbox 3
[7] => chbox 4
[8] => chbox 5
)
[submit] => submit
)
$_GET Array
(
)
When I replace the POST wit GET it works fine.
cya later
/Stephan
------------------------------------------------------------------------
[2003-01-05 16:44:45] moriyoshi@php.net
Reclassified
------------------------------------------------------------------------
[2003-01-05 14:51:42] derick@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
------------------------------------------------------------------------
[2003-01-05 14:49:13] szabo_a@interware.hu
Here some_arr[] has two values, but after POST-ing the resulting array
seems like it is repeating itself.
Example:
<!-- input -->
<form method="post">
<input type="checkbox" name="some_arr[]" value="aa" CHECKED>
<input type="checkbox" name="some_arr[]" value="bb" CHECKED>
<input type="submit">
</form>
<!-- result after post -->
var_dump($some_arr):
array(3) {
[0]=>
string(2) "aa"
[1]=>
string(15) "bbsome_arr[]=aa"
[2]=>
string(2) "bb"
}
When I replace the POST wit GET it works fine.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21441&edit=1