Ask a Question related to PHP Development, Design and Development.
-
jcg #1
why is . converted to _ in $_POST
I have a form that contains some file names (eg this.jpg). When the form
posts, and i ready $_POST, I get back this_jpg.
What is happening? how can I turn this off?
--
jcg
ColumbusWebMakers.com
jcg Guest
-
Variable _POST
Bonsoir, Je passe des variables de formulaire par la méthode post, quelle est la méthode la plus sécurisante pour la reception des données : ... -
[PHP] dump $_POST into variables????
Ah... Jason.... Man Of Few Words! THANKs... You have saved me time and lines in my code :-) Cheers! Joe -----Original Message----- From:... -
dump $_POST into variables????
Okay, curious if there is an easier way to do this... here is what I do <?php $ZipCode = $_POST; $Distance = $_POST; ?> can't I just dump... -
[PHP] $_POST problem
Nope. That didn't do it. The errors I'm receiving are: Notice: Undefined index: keywords in... -
$_POST problem
Anyone see what when I submit this, I can't do a $_POST on it? I check with the DB first to see if there is a value and if so, I fill it,... -
Andy Hassall #2
Re: why is . converted to _ in $_POST
On Thu, 27 May 2004 20:10:51 GMT, jcg <hpwebby@ameritech.net> wrote:
As the key presumably, and NOT the value?>I have a form that contains some file names (eg this.jpg). When the form
>posts, and i ready $_POST, I get back this_jpg.
PHP used to set global variables based on the names of form elements>What is happening? how can I turn this off?
submitted. Variable names cannot contain '.', so '.' got transformed to '_' in
the variable name.
Looks like this is still being done in $_POST, despite it being unnecessary
(and arguably wrong). Don't believe you can turn it off without editing PHP.
From PHP 4.3.6, see main/php_variables.c:102
/* ensure that we don't have spaces or dots in the variable name (not
binary safe) */
for (p=var; *p; p++) {
switch(*p) {
case ' ':
case '.':
*p='_';
break;
}
}
--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
[url]http://www.andyh.co.uk[/url] / [url]http://www.andyhsoftware.co.uk/space[/url]
Andy Hassall Guest
-
Joel Goldstick #3
Re: why is . converted to _ in $_POST
Thanks Andy. I decided the quick fix was to do a string replace of _jpg to
..jpg
I didn't realize . is illegal in a variable name. It kinda makes sense
though since that would confict with css.
newsgroups are great!
Joel Goldstick
Joel Goldstick Guest



Reply With Quote

