#43266 [Opn->Bgs]: $_GET/$_POST variables
| From: | johannes@php.net | Date: | Mon, 12 Nov 2007 18:59:03 +0000 |
| Subject: | #43266 [Opn->Bgs]: $_GET/$_POST variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-119566@lists.php.net to get a copy of this message | ||
ID: 43266
Updated by: johannes@php.net
Reported By: sanek469 at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Win XP
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
We can't change that for backwards compatibility
Previous Comments:
------------------------------------------------------------------------
[2007-11-12 18:12:36] sanek469 at hotmail dot com
Description:
------------
When the name assigned to a form field contains such characters as '.'
or space(' '), the $_GET/$_POST[$name] will not catch the contents of
the field using that same name, instead you have to substite '.' or ' '
with '_' in the $_GET/$_POST function.
Reproduce code:
---------------
<?php
$field = "text.field";
if(isset($_GET[$field]))
{
echo $_GET[$field];
}
?>
<form method="get">
<label>
<input type="text" name="text.field" id="text field"
value="WORKS"/>
</label>
<p>
<label>
<input type="submit" name="button" id="button"
value="Submit" />
</label>
</p>
</form>
Expected result:
----------------
WORKS
Actual result:
--------------
nothing shows up, however changing $field = "text.field" to $field =
"text_field" will display correct results.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43266&edit=1