Re: RE: help, weird include problem with functions

From: Date: Thu, 09 Aug 2001 16:57:57 +0000
Subject: Re: RE: help, weird include problem with functions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62014@lists.php.net to get a copy of this message
You need to include settings.php in functions.php. ----- Original Message ----- From: "Jaxon" <jaxon@salamander.net> To: <php-general@lists.php.net> Sent: Thursday, August 09, 2001 12:48 PM Subject: [PHP] RE: help, weird include problem with functions > oh, this still happens when I fix the missing () in the foo declaration :) > > cheers, > jaxon > > > -----Original Message----- > > From: Jaxon [mailto:jaxon@salamander.net] > > Sent: Thursday, August 09, 2001 12:34 PM > > To: php-general@lists.php.net > > Subject: help, weird include problem with functions > > > > > > > > can anyone tell me why this doesn't work?? > > assuming I have these three files: > > > > settings.php is: > > <?php $bar="someval"; ?> > > > > page.php is: > > <?php > > require("settings.php"); > > echo "$bar from page.php"; //this works!!! > > include "function.php"; > > ?> > > > > > > function.php is: > > <?php > > function foo{ > > global $bar; > > echo "$bar from foo"; //this does not work!!! > > } > > foo(); > > ?> > > > > for some reason the $bar in function foo() doesn't have a value... :( > > calling page.php only returns the $bar from page.php > > > > thanks in advance! > > jaxon > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#62014) next »