Hey, so i have this folder named /views in this folder i have two more folders one of them are called /layouts and another /jobs. There is a file /views/layouts/staff.php and another file is in /views/jobs/index.php. I want to include staff.php in to my index.php file. I know a this super global $_SERVER['DOCUMET_ROOT'], it gives out a root path. So I tried this in staff.php : <?php include($_SERVER['DOCUMET_ROOT'].'/'.'project/views/jobs/index.php'); ?> Code (markup): I had an error: Warning: include(C:/wamp/www//project/views/jobs/index.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\project\views\layouts\jobs.php on line 3 Warning: include() [function.include]: Failed opening 'C:/wamp/www//project/views/jobs/index.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\project\views\layouts\jobs.php on line 3 Code (markup): So I assume that I must somehow change includes path, can someone help me with this little problem?
The problem ? I see // in between /www//project So simple change your line to: <?php include($_SERVER['DOCUMET_ROOT'].''.'project/views/jobs/index.php'); ?> Code (markup):
What about the spelling of DOCUMENT you have DOCUMET This works fine for me : <?php include($_SERVER['DOCUMENT_ROOT'].'/'.'project/views/jobs/index.php'); ?>