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.

277 Like 18 Dislike
Previous php-forum Next php-forum
Other php-forum

removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

New Search Engine problem
Hey everyone,

I have a ZIP Code Radius search engine already functional. it displays all of t

update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an

Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

BB_Code error
I'm having a problem with a custom built function and keep getting this error:


Warning: M

Mail sending is slow on server
Why mail is taking time to be send on apache-linux server

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

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