I'm making an application and trying to implement a new idea I had that if I can get it to work would result in a more portable, and easy to use application structure. Ok so onto my problem.
I'm trying to include one file on every page of my application (that needs files included) and then call a function out of that included file. The function contains a switch, and based on the value passed to the function, different files are included. So we include includes.php, and includes.php has a function in it that will be used to include all other pages. Well this setup seems to work. I include includes.php on my index.php, and then call the function, and pass it the value 'index'. That value tells the switch to include a file with some database functions and a file with some page functions. Now this setup works, almost..
The variables in the database functions file are not being parsed it seems. They are not working at all. The variables are defined right in the file, and then used in functions in the file. Note that in the functions in the database functions file, I declare the variables as global to jump outside the scope. I try to use the variables in my functions, or echo them outside the functions, and nothing. This is the problem I'm having.
If I include the two files normally, without includes.php in the middle, then everything works fine. Does anyone have any ideas? I'd appreciate any help. Thanks.