help with global not working
| From: | Joey | Date: | Wed, 13 May 2009 08:48:36 +0000 |
| Subject: | help with global not working | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-292520@lists.php.net to get a copy of this message | ||
Hello All,
I am running into a problem after I moved a site from a server with PHP4 to
PHP5.
As an example I have a variable defined at the top of my code lets say:
$test_mode = "no";
Then within the code I check if we are in test mode to bypass certain
functionality like so:
function runTransaction() {
global $test_mode;
do some things;
do some more things;
if ($test_mode == "yes") {
don't do anything;
} else {
Do something;
}
My problem is that $test_mode NEVER contains the value "no".
Any ideas appreciated.
Joey