Hi i'm making a forum on my site. I have the dependent files stored on my server at: "includes/mod_forum/foum"
my index.php page stored in the initial directory (before "inlcudes/../..") has a link to a file forum.php in the same local directory as index.php.
In the file forum.php i have set an include function: "<?php include('includes/mod_forum/forum/index.php'); ?>
"
The index.php file and a file called post.php stored in "includes/mod_forum/forum/" both require a connection to my sql database.
The file that sets the database credentials is stored in "includes/_config/connection.php".
When i access the index.php file directly stored at "includes/mod_forum/forum/" it finds the connection.php file fine and connects to my database but when i access forum.php in the local/home directory (before "inlcudes/../..") it can not find the connection.php file to connect to the database.
Any ideas why this is?
Hope i've explained this ok.
Heres the errors i'm getting:
Warning: include(../../_config/connection.php) [function.include]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/PTB1/includes/mod_forum/forum/index.php on line 252
Warning: include() [function.include]: Failed opening '../../_config/connection.php' for inclusion (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/PTB1/includes/mod_forum/forum/index.php on line 252
Warning: include(../../_config/connection.php) [function.include]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/PTB1/includes/mod_forum/forum/posts.php on line 2
Warning: include() [function.include]: Failed opening '../../_config/connection.php' for inclusion (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/PTB1/includes/mod_forum/forum/posts.php on line 2
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/PTB1/includes/mod_forum/forum/posts.php on line 122