Home > Archive > PHP Documentation > May 2004 > Re: [PHP-DOC] Question about using <varname>
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PHP-DOC] Question about using <varname>
|
|
| Gabor Hojtsy 2004-05-26, 2:35 pm |
| > Can you explain me, why we should write <varname>PHP_AUTH_USER</varname>
> without symbol '$' and <varname>$HTTP_SERVER_VARS</varname> with it?
If you use the $ symbol, then it suggest that the global variable usage
is suggested. PHP_AUTH_USER is supposed to be in the _SERVER array if I
remember correctly, and if you write it with $, then you promote the
usage of register_globals = on, which is not right. $HTTP_SERVER_VARS is
the only way to access the ther variable, so it is fine with the dollar.
It might be an option to write
<varname>$_SERVER['PHP_AUTH_USER']</varname> (in case I am not mistaken,
and this is part of the server superglobal).
Goba
| |
| Gabor Hojtsy 2004-05-26, 5:32 pm |
| >>>Can you explain me, why we should write
>
> GH> If you use the $ symbol, then it suggest that the global variable usage
> GH> is suggested. PHP_AUTH_USER is supposed to be in the _SERVER array if I
> GH> remember correctly, and if you write it with $, then you promote the
> GH> usage of register_globals = on, which is not right. $HTTP_SERVER_VARS is
> GH> the only way to access the ther variable, so it is fine with the dollar.
>
> So, next part of PHP-manual:
>
> For example,
> <varname>$userfile_name</varname> will equal
> <varname>$_FILES['userfile']['name']</varname>,
> <varname>$userfile_type</varname> will equal
> <varname>$_FILES['userfile']['type']</varname>, etc.
>
> I should change to:
>
> For example,
> <varname>userfile_name</varname> will equal
> <varname>$_FILES['userfile']['name']</varname>,
> <varname>userfile_type</varname> will equal
> <varname>$_FILES['userfile']['type']</varname>, etc.
>
> Am i shure?
Please give more context. This seems to be a part which explains how
register_globalled stuff was changed, so there the $ has the role to
show how it was with register globals. If this is the case, then the
dollar should not be removed. The question is not simply have the dollar
or not, since it always depends on the context.
Goba
| |
| Gabor Hojtsy 2004-05-26, 6:32 pm |
| > GH> Please give more context. This seems to be a part which explains how
> GH> register_globalled stuff was changed, so there the $ has the role to
> GH> show how it was with register globals. If this is the case, then the
> GH> dollar should not be removed. The question is not simply have the dollar
> GH> or not, since it always depends on the context.
>
> Thank's for your explain.
> Can you review my latest commit?
Seems to be fine to me.
Goba
|
|
|
|
|