Re: php forgetting variables very easily

From: Date: Wed, 05 Mar 2003 15:05:17 +0000
Subject: Re: php forgetting variables very easily
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138279@lists.php.net to get a copy of this message
> I am still having problems with variables not being > remembered by included files. I've tried using the > global command and it still doesn't work. I've cut > down my two pages to contain the main stuff so you can > see what's happening. Basically main.php includes the > file new.php and I want the variable '$name' to be > remembered in it. The other included files aren't > important to the problem I'm having. I just cut and pasted your code, commenting out the include()s you say aren't important and the $name variable prints out fine. Are you sure your not overriding its value in one of the other included files? On the other hand, terés no need to use global, this is only when you want to use global variables _inside_ a function. Cheers!

« previous php.general (#138279) next »