Forum Moderators: coopster
I have only recently found the need for using php includes and I thought I was all sorted .... until now.
I have been using the following code to include my menu bar
<? include $HTTP_SERVER_VARS["DOCUMENT_ROOT"] . '/includes/menu.php'; ?>
Everything was working OK until I needed to add another level of directory. ie. I have pages in my root directory (index, contact etc) and then I have directories containing other pages. This was still working OK providing I didn't update links when I made a new page.
Now I have the need for another level of directory ie, attractions/walks.
The includes for header and footer work just fine at this level, however, the menu include doesn't work. It shows, but the links are wrong. Instead of looking back to the root dir for the includes folder, it looks back as attractions/sightseeing or attractions/accommodation, instead of just "sightseeing" or "accommodation"
I have used a 1st level template to create the pages and have tried daving the pages with and without updating links and this hasn't made any difference.
Could someone please help me.
Thanks so much
Di
My path to home is /home/discover/public_html/includes/menu.php . Can you please show me how it should be written into the code.
Thanks so much
Cheers
Di