Forum Moderators: coopster
Well here it is.
I am starting up with follwing two lines of code and have nothing else on the page the db_Funftion.php gives me an error like the one below for no good reason. Both files are there in the same directory. If I change the order function.php will still work but db_Funftion.php will not. I have not changed anything in that file and it used to work. If I take the content from db_Funftion.php and copy it in to my calling file the code works just fine. What is going on?
include ('../inc/function.php');
include ('../db_Funftion.php');
Warning: main(../inc/function.php): failed to open stream: No such file or directory in /var/www/docs/archives/docs.php on line 1
Warning: main(): Failed opening '../inc/function.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/docs/archives/docs.php on line 1
[edited by: coopster at 11:32 am (utc) on Mar. 18, 2005]
[edit reason] removed url [/edit]
include ($_SERVER['DOCUMENT_ROOT'] . 'inc/function.php');
(if the inc folder is in your servers document root directory)
It should work as is though. I think using document root might open up an additional path disclosure vulnerability... not sure on that one. I'm a little uncertain of this, but I think document root also on a windows file system returns a structure that will be incompatible with the forward slash type structure...
try it anyway, see how it goes...
Here is my error and file structure ae well. This looks like a bug doesn't it?
Warning: main(/var/www/inc/db_function.php): failed to open stream: No such file or directory in /var/www/test/test2.php on line 3
Warning: main(): Failed opening '/var/www/inc/db_function.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test/test2.php on line 3
Functions Include OK
Fatal error: Call to undefined function: selectquery() in /var/www/test/test2.php on line 7