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
[Back to original message]
|