View Single Post
Old 10-08-2012, 06:35 AM   PM User | #1
andrew55
New Coder

 
Join Date: Mar 2012
Posts: 18
Thanks: 4
Thanked 0 Times in 0 Posts
andrew55 is an unknown quantity at this point
Need help with SSI paths in php

I just migrated to a new hosting account. Almost all of my files are in php. In my last hosting account, to create a server side include, I used something like:

PHP Code:
<?php 
require_once($_SERVER['DOCUMENT_ROOT'].'/includes/header.php'); 
?>
New hosting account won't seem to let me do this. Everything has to be relative such as

PHP Code:
<?php 
include ("../includes/header.php"); 
?>
But...this also seems to work in the new hosting account:


PHP Code:
<?php 
include ("includes/header.php"); 
?>
Is it OK to code all SSIs as demonstrated in the last example, or is this a bad practice. Having to set the relative paths will be much more complex and time consuming so I'm trying to avoid it. Thank you for any suggestions.

Last edited by andrew55; 10-08-2012 at 06:38 AM..
andrew55 is offline   Reply With Quote