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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: galg at sphera dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC