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

output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex.

Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

The page should be expire when cilck back button
hi,
i'm new to php world.
i create user registration page.
when i submit it,data goes to my

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Remove letter from numeric textbox
I have a textbox that will search the employee database by entering in the employee ID and it will r

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Sessions Value Not Saved
Hi,

Im making a login form and im using this code:
Code: if($login=="true"){

Writing to the middle of a file
Hi I have a bit of a problem. Is there any way i can write some text to a middle of a text file. For

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