You are here: Re: $_POST + spaces and dots in keys « PHP Programming Language « IT news, forums, messages
Re: $_POST + spaces and dots in keys

Posted by Justin Koivisto on 12/10/05 00:39

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация