Basic Question Regarding PHP Includes


Posted on 16th Feb 2014 07:03 pm by admin

Hi

Just starting out with PHP.

Working on a site that uses some basic includes, these are working fine for all my files in the root of my site as the links from the header include is just linking straight to pages for example contactUs.php

I am now however having to create some new folders to hold some product ranges, these are two folders down from the root of the site. I can link to the includes fine but the links don't work, to work they would need ../../ etc

Now I could create a new header include file especially for use by the files in the deeper folders or I could make the links absolute but I just wondered if there was another way?

I wondered if you could use PHP to perhaps detect the folder level and then add the necessary path???

I don't know am I way off the mark?

Any help / tips much appreciated.

No comments posted yet

Your Answer:

Login to answer
277 Like 18 Dislike
Previous forums Next forums
Other forums

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

Problem with Subscreen
Dear Experts ,
I am facing a problem with the subscreens. My senario is as follows :

PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work s

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

sapgui f4 help last search
I know this has to be simople. One user (maybe more) does not have the "last search saved" from the

Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.

I have maxminds geoip lite installed and i

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash