Variables empty via included files?
Posted: Fri Jul 21, 2006 12:59 am
(Sorry if this has been asked before, I found it difficult to narrow my search results)
I've been using php for at least a year and a half now that has been hosted on a linux server.
Recently I tried creating a backup of my webpage on an ubuntu laptop I have at home via DynDns and it appears to accessable like that (at least on my network anyway).
However I was running into some problems where parametres passed via the address-bar were ignored completely.
I decided to look into it and (whether it is related or not) I discovered that my variables were no longer accessable from within included files where they have been (and still are) working on the hosted server.
This is a summary of what what I did to test the output.
Within index.php:
echo "//1: ".$path;
include "menu/menu.php";
echo "//3: ".$path;
Within menu/menu.php:
echo "//2: ".$path;
When I viewed the source #1 & #3 had echoed $path but #2 had not. (#2 is not within a function - so it's not just me forgetting to put "global" in).
Is there a setting by that disables that functionality? Any suggestions or a poke in the right direction would be appreciated.
I've been using php for at least a year and a half now that has been hosted on a linux server.
Recently I tried creating a backup of my webpage on an ubuntu laptop I have at home via DynDns and it appears to accessable like that (at least on my network anyway).
However I was running into some problems where parametres passed via the address-bar were ignored completely.
I decided to look into it and (whether it is related or not) I discovered that my variables were no longer accessable from within included files where they have been (and still are) working on the hosted server.
This is a summary of what what I did to test the output.
Within index.php:
echo "//1: ".$path;
include "menu/menu.php";
echo "//3: ".$path;
Within menu/menu.php:
echo "//2: ".$path;
When I viewed the source #1 & #3 had echoed $path but #2 had not. (#2 is not within a function - so it's not just me forgetting to put "global" in).
Is there a setting by that disables that functionality? Any suggestions or a poke in the right direction would be appreciated.