Re: Bug or programmer-error?

From: Date: Sat, 06 Aug 2005 15:19:32 +0000
Subject: Re: Bug or programmer-error?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220144@lists.php.net to get a copy of this message
Rob Ziere wrote:
Dear PHP_friends, I have found a strange behaviour of the "include" function. Here it is .
           // 1. this works fine 
                       include ("../../gps_info/fetch_fields.php");
           // 2. this works fine
                       $doc_root=$_SERVER[DOCUMENT_ROOT];
                       include
("$doc_root"."/pages/gps_info/fetch_fields.php");
           // 3. this open the doc fetch_fields.php allright, but variables
that have been set outside fetchfields.php are not available within fetch_fields.php
You could try calling a var with global first global $variable (reference: http://nl2.php.net/global )
                       $root= 'webserver-2';
                       include
("$root"."/pages/gps_info/fetch_fields.php"); Does anybody have a clou as to what's wrong here? Best regards/ Met vriendelijke groet, Rob Ziere Webmaster/beheerder GO-GPS.nl, alles over GPS en wandelen http://www.go-gps.nl


« previous php.general (#220144) next »