Ok let me try to explain.. head.php directory/page.php I need to phpinclude head.php INTO page.php. So page.php would have the include command. Why doesn't <?php include("/head.php"); ?> work? ../ doesn't, and ./ doesn't also. Is it something with my host's PHP config? Or am I doing something wrong? Oh and http includes aren't allowed. Please help, thanks
you don't need parenthesis I believe, the path is relative to the script that is running. I always use full working path, because error pages call the "/" site root wrong when using include other than a full path. KWIM? <?php @include 'public_html/yoursite/head.php'; ?>
Simple... <?php include '../head.php'; ?> Code (markup): If you want to use absolute paths (recommended), have a constant or variable named app_root or similar and prefix filenames with it.