You are here: Re: method="POST" changes '.' to '_' « PHP Programming Language « IT news, forums, messages
Re: method="POST" changes '.' to '_'

Posted by Andy Hassall on 07/06/06 22:25

On 6 Jul 2006 15:07:59 -0700, "Robert S" <robert.spam.me.senseless@gmail.com>
wrote:

>I am trying to use POST to transfer data to another page. When I do
>this, '.' characters get converted to"_". For example:
>
>#index.html:
><form action="test.php" method="post">
><input type="submit" name="filename.txt">
></form>
>
>#test.php
><html>
><?php
>var_dump( $_POST );
>?>
></html>
>
>This displays:
>
>array(1) { ["filename_txt"]=> string(12) "Submit Query" }
>
>ie 'filename.txt' is changed to 'filename_txt'
>How can I stop this behaviour?

You'd have to patch PHP.

See main/php_variables.c, php_register_variable_ex
(line 92 in PHP 5.1.4):

/* ensure that we don't have spaces or dots in the variable name (not binary
safe) */
for (p = var; *p; p++) {
if (*p == ' ' || *p == '.') {
*p='_';
} else if (*p == '[') {
is_array = 1;
ip = p;
*p = 0;
break;
}
}
var_len = p - var;

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

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

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