Re: $_POST + spaces and dots in keys
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: $_POST + spaces and dots in keys

From: Justin Koivisto <justin@koivi.com>
Date: Fri Dec 09 2005 - 23:39:25 CET

Sergei Riaguzov wrote:
> I have a very strange behaviour with POST keys.
>
> Consider a test:
>
> wtf.html:
>
> === Cut ===
> <form action="eh.php" method="POST">
> <input type="checkbox" name="many spaces and. . dots. . "/>
> <input type="submit" value="Submit">
> </form>
> === Cut ===
>
> eh.php:
>
> === Cut ===
> <?php
> print_r($_POST);
> ?>
> === Cut ===
>
> When we check the checkbox and click the Sumbit button we will see:
>
> Array ( [many_spaces_and____dots____] => on )
>
> It is send to server normally:
>
> many+spaces+and.+.+dots.+.+=on
>
> but in $_POST (or $HTTP_POST_VARS) we see what we see. Any ideas?
>

See the "cannot use "-" in variable names?" thread...

Basically, what I thought was any character that can't be used in a
variable name was automagically converted to an underscore, but
apparently "-" aren't any more.

-- 
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
Received on Sun Dec 11 14:29:32 2005