php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14099 POST/GET - if there is a dot in the name it's changes to "_"
Submitted: 2001-11-18 12:29 UTC Modified: 2001-11-19 18:10 UTC
From: galg at sphera dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.0.6 OS: Linux, Red-Hat 6.2
Private report: No CVE-ID: None
 [2001-11-18 12:29 UTC] galg at sphera dot com
When i submit a form where is a dot in the name it's changes to "_".
for example:
<form action="<=$PHP_SELF>" method="post" name="aaa">
	<input type="text" size="12" name="127.0.0.1" value="66.55">
	<input type="submit" value="send me">
</form>

when runing in PHP:
foreach ($HTTP_POST_VARS as $key=>$val){
	echo "$key = $val<BR>";
}

the output will be : 127_0_0_1 = 66.55

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-18 12:31 UTC] galg at sphera dot com
When i submit a form where is a dot in the name it's changes to "_".
for example:
<form action="<?=$PHP_SELF;?>" method="post" name="aaa">
	<input type="text" size="12" name="12.13.14" value="66.66">
	<input type="submit" value="send me">
</form>

when runing in PHP:
foreach ($HTTP_POST_VARS as $key=>$val){
	echo "$key = $val<BR>";
}

the output will be : 127_0_0_1 = 66.55

 [2001-11-18 12:52 UTC] mfischer@php.net
That's intended behaviour. You can't have dots in variable names, the dot is already used for string concatenation.

Bogus.
 [2001-11-19 03:49 UTC] galg at sphera dot com
even if you use &#046; it's been replaced to "_".
in many other languages this is possible.

<form action="" method="post" name="aaa">
	<input type="text" size="12" name="12.13&#046;14" value="66.66">
	<input type="submit" value="send me">
</form>
 [2001-11-19 18:10 UTC] sniper@php.net
Maybe in other languages but not in PHP. As Markus already
said, '.' is reserved character in PHP.

Even if you encode it it will be seen as . in server side.

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Feb 25 19:01:24 2021 UTC