I'm getting really muddled up now and my brain hurts! :( lol
Root:
- index.php
Includes:
- cat.php
- dog.php
index includes dog: include("includes/dog.php");
dog includes cat: include("cat.php");
When I run index, for cat it says:
- A link to the server could not be established
- Access denied for user ...
However, if I run dog, I get no problems...
I'm guessing its the path, but i've tried ./includes/cat.php to no joy...
Thanks for this nice thread.
I used bart's answer to solve this issue. But I still have one question here.
I was surprised that it worked in my mate's system even without using
dirname(__FILE__)
so I did little research and compared both php.ini files. I noticed there is little difference atinclude_path
parameter in php.ini.In my php.ini it is set to Pear directory. So I commented out just to test and to my wonder it worked. This is when I realized we need to include some folder which I dont know or comment it out so that it takes default value.