include in PHP carry over variables?
Moderator: General Moderators
include in PHP carry over variables?
When you do include(filename) shouldnt the variables from the included file work on the file with include in it?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
I seem to be having the problem when I include a file from another directory. Any more help?
Here is hte line:
Hmm, could it be cause of multplie includes? Cause the file that config is being included in is in the same directory, but then that file is being included in a another directory? Its a tangled web, aint it?
Here is hte line:
Code: Select all
require("http://www.drivingwithflats.com/news/config.php");- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
try
Code: Select all
require_once("http://www.drivingwithflats.com/news/config.php");- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You still haven't actually said what the problem is. Is there an error message or is code just not working as expected, if so what does it do and what did you expect. If it is a problem with including files multiple times, require_once() or include_once() should solve that as hob_goblin said.
Mac
Mac