hi all, i'm having a hard time trying to fix the path error i recieve. i'll explain the file organization a bit.
the files of the site are all put in '/htdocs/stuff'. so, in that same directory i have a cfg.php file which contains:
Code: Select all
<?php
define('root', '/htdocs/stuff');
?>
i have a file switch_page_admin.php which is in '/htdocs/stuff/func' and i need to include it in index.php which is in '/htdocs/stuff/admin'. what i do is inlude cfg.php, and use the constant 'root' to indicate the path of switch_page_admin.php. here's how it looks in index.php:
Code: Select all
<?php
include('../cfg.php'); //since index.php is in '/htdocs/stuff/admin' and cfg.php is in '/htdocs/stuff'
include(root . '/func/switch_page_admin.php');
?>
i get (Warning: main(/htdocs/stuff/func/switch_page_admin.php): failed to open stream: No such file or directory) when i run index.php although i double checked - switch_page_admin.php is there (in '/htdocs/stuff/func'). now what do i do wrong here? i'm a true beginner so i probably missed something.