Re: Problem with input name, how can i use . (dot) in a name of a input type text?
| From: | Stut | Date: | Mon, 05 Nov 2007 14:25:08 +0000 |
| Subject: | Re: Problem with input name, how can i use . (dot) in a name of a input type text? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264052@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
Stut wrote:Indeed. I think technically this would be a bug because in an ideal world it would only be transformed when extract'ed from the array. There's no reason to transform it prematurely. -Stut -- http://stut.net/Jônata Tyska Carvalho wrote:I think Stut is correct - the period is a concatenation operator. also there are plenty of alertnatives to the Stuts suggested 'table[name]' naming approach. that said given the following code: $f = "my.bad"; $$f = "MY BAD"; echo $f, "\n", $$f, "\n"; ... I personally feel that the $_POST should just contain 'table.name' - which is not an illegal array key - most likely the reason it is (the var name) transformed is due to BC, namely with register_globals set to ON php is required to automatically create a variable $table.name (which is not legal).Im having a big problem because the name of one input type text that is ' table.name' in my html, becomes 'table_name' in php, it is a kind of bug?? =S <form method="post"> <input type="text" name"table.name"> </form> in PHP we have: $_POST["table_name"] instead of $_POST["table.name"] someone knows some way to put this to work?? i wanna send 'table.name' and receive in php 'table.name'!I don't know for certain but that's likely happening because a period is not valid in a PHP variable name. One alternative would be to use table[name] instead. This will lead to $_POST['table']['name'].