Hi,
I have made a website for my son and while everything works okay, he wishes to change hosting company.
Having uploaded the site to the new host there is a problem with it finding the include files
The current site is http://www.dalrenmodels.co.uk/ and this works fine
He has set a tempory space on the new host so we can test the site before changing the name servers
That new space is http://www.dalrenmodels.co.uk.gridhosted.co.uk/ but this is where we are having the problem although all the code is identical ( I have simply uploaded all the existing files to the new space)
In the code there is reference to two include files, menu.php and footer.php. I need to keep these file separate otherwise I would have to change the code in every page if I update the menu or footer.
The code in question in my index.php files is:
<?php
include $_SERVER[‘DOCUMENT_ROOT’] . ‘/includes/menu.php’;
?>
Plus similar for the footer.
To make the home page work on the new hosting I have to prefix the include command with a single dot, just before the first slash, thus:
include $_SERVER[‘DOCUMENT_ROOT’] . ‘./includes/menu.php’;
However, this still does not fix the other pages.
There are model category pages (accessed from the footer) and to make these pages work I have to prefix the command with two dots, thus:
include $_SERVER[‘DOCUMENT_ROOT’] . ‘…/includes/menu.php’;
This then breaks the home page and the individual model pages still don’t work. To make them work I have to prefix the command with two dots, a slash and two dots, thus:
include $_SERVER[‘DOCUMENT_ROOT’] . ‘…/…/includes/menu.php’;
But this then breaks everything else.
I hope I haven’t rattled on too long and someone can explain what is going on and how I can fix it.
Thank you in advance for any help you can give,
regards
Brian