I have a php page and I am importing an other one. In the start of the first php file I am opening up the DB and all that, furuther down in that PHP file I am importing the the other one. Do I still have to open the DB in that file too?
ØØ
Printable View
I have a php page and I am importing an other one. In the start of the first php file I am opening up the DB and all that, furuther down in that PHP file I am importing the the other one. Do I still have to open the DB in that file too?
ØØ
No. It will inherit the connection.
When you import a file using include or require te following happens:
- PHP mode exits and HTML mode is entered.
- The entire file is evaluaated as if it were at there at that point in the soource code.
You have access to all the variables you would originally have access to. If inside a function you will have access to all the local variables and the global variables from the $GLOBALS array, just like you normally would.
Thanks that worked exactly as you guys said.
1/5 of my menu is PHP now...:)
http://63.247.129.10/~oyvost/
Reps are out to both of you...well not you Adam, I have to spread them a bit more first..;)...I have it on a yellow post-it so I won't forget though..:)
ØØ