I have the following directory structure.
htdocs/ dir1/ c.php
dir2/ a.php b.php
How do I include c.php in a.php.
I have tried include '../dir1/c.php' . It's generating an error "Failed to opening ........ for inlusion (include_path=';c:\php\pear') in ......
Thanks.
Websever is online.
Are you using a webserver offline, because sometimes I get the same problem, once you launch the code online the '../dir1/c.php' will work, while its still offline, I normally just use 'c:\php\name.php', the full path.
hope that helps.
Webserver is online.
try chnaging your INCLUDE path in php.ini
If it is your server and you can edit the php.ini file why not just change the php_include_path to be the root of your site. (/htdocs/)
That said...if you are in windows...you need to specify the path in windows terms. So...instead of ../dir1/c.php you would want ..\dir1\c.php. The relative path should work fine. That is the way I rock it.
andy