Re: Question about "Undefined variable: PHP_SELF/HTTP_HOST"
| From: | Rasmus Lerdorf | Date: | Wed, 14 Jun 2000 18:54:23 +0000 |
| Subject: | Re: Question about "Undefined variable: PHP_SELF/HTTP_HOST" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1853@lists.php.net to get a copy of this message | ||
Are you in a function? If so, you need to read
http://www.php.net/manual/language.variables.scope.php
On Wed, 14 Jun 2000, Elsenbeck, Jim wrote:
> I'm new to PHP, and am adapting some code. I'm stuck with
> warnings due to PHP_SELF and HTTP_HOST being undefined. I
> inserted a phpinfo(); just before the offending lines and
> the output shows these two variables being defined...so
> what gives? code snippet:
> ....
> phpinfo();
> echo "self $PHP_SELF";
> echo "host $HTTP_HOST";
> ....
>
> Output shows tons of phpinfo stuff, followed by:
> Warning: Undefined variable: PHP_SELF in
> c:\inetpub\wwwroot\message\admin\index.php on line 47
> self
>
> Warning: Undefined variable: HTTP_HOST in
> c:\inetpub\wwwroot\message\admin\index.php on line 48
> host
>
> Any ideas? This is PHP4 on w2k (yuck).
>
> jim
>
>
> - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
> This e-mail and any attachments may contain information which is
> confidential, proprietary, privileged or otherwise protected by law. The
> information is solely intended for the named addressee (or a person
> responsible for delivering it to the addressee). If you are not the intended
> recipient of this message, you are not authorized to read, print, retain,
> copy or disseminate this message or any part of it. If you have received
> this e-mail in error, please notify the sender immediately by return e-mail
> and delete it from your computer.
>
>
>