Re: [PHPLIB] Undefined variable: _PHPLIB in prepend.php3 From: andre anneck (andre <email protected>)
Date: 01/08/00

I believe the problem lies inside of the if condition.

the "is_array" tries to access the variable and doesnt find it.
it returns false, thus it works as intended.
If a variable doesnt exist it can not be an array.. dooh!

You can get rid of the warning like this.
if(isset($_PHPLIB) AND is_array($_PHPLIB)) {

...yadda...

}

PHP still looks at the if conditional form left to right I belive,
a guru might want to correct me if I am wrong.

Cheers,
Andre

Jack Lauman wrote:
>
> I am running PHP v4.0b3-RC2 as an Apache modules along with PHPLIB
> v7.2. The log file is filling up with the following warning message:
>
> PHP Warning: Undefined variable: _PHPLIB in prepend.php3 on line 12
>
> Here is a snippet of the first ## lines of prepend.php3:
>
> <?php
> /*
> * Session Management for PHP3
> *
> * Copyright (c) 1998,1999 SH Online Dienst GmbH
> * Boris Erdmann, Kristian Koehntopp
> *
> * $Id: prepend.php3,v 1.9 1999/10/24 10:21:24 kk Exp $
> *
> */
>
> if (!is_array($_PHPLIB)) {
> # Aren't we nice? We are prepending this everywhere
> # we require or include something so you can fake
> # include_path when hosted at provider that sucks.
> $_PHPLIB["libdir"] = "/home/httpd/php/"; <<--- line 12
> }
>
> require($_PHPLIB["libdir"] . "db_mysql.inc");
>
> -----
>
> How can I fix this to get rid of the error? The PHP include directory
> is located at /home/httpd/php/
>
> Regards,
>
> Jack
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.