This works: <?php $thispath = "/home/user/somedomain.com/public_html/somefolder/" ?> <?php include $thispath.'navigation.php'; ?> PHP: This does not: <?php include '/somefolder/navigation.php'; ?> PHP: Is there a workaround?
Use: <?php include 'somefolder/navigation.php'; ?> PHP: Because your using /somefolder/navigation.php it is tryignt o include the root linux folder somefolder, so remove the first / to use somefolder in the scripts directory
What if the script is called from someotherfolder/subfolder/script.php will the <?php include 'somefolder/navigation.php'; ?> PHP: work? The directory structure is public_html/somefolder public_html/somefolder/navigation.php public_html/someotherfolder/subfolder public_html/someotherfolder/subfolder/script.php
<?php include '../navigation.php'; ?> PHP: [B].[/B] - current directory [B]..[/B] - previous directory [B]/somepath[/B] - assumes that somepath is in the root folder [B]somepath/[/B] - assumes that somepath is in the current directory Code (markup):
I just decided to use <?php include $_SERVER[DOCUMENT_ROOT].'/somefolder/navigation.php'; ?> PHP: and it works fine. Thanks everyone!