Calling 5 sub folder using include();

rsbypi4

New member
Good day, I want to call my page. But my page stored in the 5th sub folder.
I try to call my page using include,

PHP:
<?php
    include('.../page.php');
    ?>
But this codes not working, someone can teach me how to access my page that located in the 5th subfolder.
 
Try this:
PHP:
<?php    include('../../../../page.php');?>
Your include() statement is incorrect because .../page.php is not a valid way to navigate up directories in PHP.
Instead of using relative paths, you can use an absolute path with $_SERVER['DOCUMENT_ROOT']:
Example:
PHP:
<?php
    include($_SERVER['DOCUMENT_ROOT'] . '/page.php');
?>
 
Back
Top