php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11097 HTML Form Variable Error
Submitted: 2001-05-24 16:40 UTC Modified: 2001-05-24 17:00 UTC
From: brw at brw dot net Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.0.5 OS: Linux 2.4 kernel
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: brw at brw dot net
New email:
PHP Version: OS:

 

 [2001-05-24 16:40 UTC] brw at brw dot net
After messing with some PHP functionality, I decided that I wanted an input field to be named like the following.

func[name]

the HTML looks like this.

<input type="hidden" name="func[name]" value="blah()">

The unfortunate thing is that PHP treats the name func[name] as an array.  I.e., $func.

If this is supposed to act like this then ok, but I would guess this would not be a good idea.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-24 17:00 UTC] cardinal@php.net
No, this is quite intentional.

For example, if you wanted to use a <select multiple> list, name it "list[]", and all the options that get selected will go into the array.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jun 19 18:01:23 2021 UTC