Bug #16513 Updated: array through http form
| From: | cynic@php.net | Date: | Tue, 09 Apr 2002 15:33:40 +0000 |
| Subject: | Bug #16513 Updated: array through http form | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-4450@lists.php.net to get a copy of this message | ||
ID: 16513
Updated by: cynic@php.net
Reported By: martijn@tiel.nu
Status: Bogus
Bug Type: Output Control
Operating System: windows xp / linux
PHP Version: 4.1.2
New Comment:
echo "this is {$foo['bar']['baz']} an array index";
echo "this is $foo[bar][baz] an array index";
both versions will work. this is (and has been since I remember)
documented
in the manual.
Previous Comments:
------------------------------------------------------------------------
[2002-04-09 11:33:18] sander@php.net
This works:
echo "{$HTTP_POST_VARS['personal']['name']}";
RTM!
------------------------------------------------------------------------
[2002-04-09 11:27:37] martijn@tiel.nu
This looks to me like a serious bug not a request.
The only solutions is to set global_register to "on" which
ain't very save. (according the manual!).
What i'm trying to say is: YOU CAN'T PASS AN ARRAY ANYMORE!
unless ...
------------------------------------------------------------------------
[2002-04-09 09:18:54] sniper@php.net
Try putting {} around the variable name..
------------------------------------------------------------------------
[2002-04-09 09:18:26] sniper@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
------------------------------------------------------------------------
[2002-04-09 09:16:09] martijn@tiel.nu
When passing an array through a form echo is running into trouble.
example:
<form action="array.php" method="post">
Name: <input type="text" name="personal[name]"><br>
Email: <input type="text" name="personal[email]"><br>
<input type="submit">
on the next page, i'm trying to retrieve the values:
print_r($personal) says: Array ( [name] => martijn [email] =>
martijn@tiel.nu ).
echo "$HTTP_POST_VARS['personal']['name']";
no value is being displayed.
echo $HTTP_POST_VARS['personal']['name']; (whithout "")
the value is displayed, but the function 'echo' doesn't work properly
anymore.
I hope someone can explain me why.
regards Martijn
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16513&edit=1