Re: $_SELF[PHP_SELF] not working anymore
| From: | Maria Garcia Suarez | Date: | Tue, 16 Sep 2003 15:45:22 +0000 |
| Subject: | Re: $_SELF[PHP_SELF] not working anymore | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162757@lists.php.net to get a copy of this message | ||
Hi there!
First, thanks for your reply...
--- Curt Zirzow <php-general@zirzow.dyndns.org> wrote:
> * Thus wrote Maria Garcia Suarez
> (mariagarciasuarez@yahoo.com):
> > > Try with $_SERVER["PHP_SELF"]
> > Then I get:
> > Parse error: parse error, unexpected
> > T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or
> > T_VARIABLE or T_NUM_STRING in
> > This is how I use it:
$currentAddress="$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF]";
> You should always quote your array keys (cept if all
> the keys are
> numeric. Also when inside a string, enclose your
> variables with
> {}.
$currentAddress="{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
> php wont be so confused as what you're trying to do.
I also tried with $_SERVER[PHP_SELF] alone (echo
"$_SERVER[PHP_SELF]"; or echo
"$_SERVER['PHP_SELF']";), and it doesn't work. I
personally don't think PHP is confused about what I'm
trying to do...
Thanks anyway.
Do you have any other idea? I already ran out of
them... :-(
Kisses,
Maria
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com