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

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

SAP FICO learning materials
Hi all,
I am new to this world of SAP FICO. I have taken training on SAP FICO, but was wonderin

Mail Form receiving emails with no content
Hi, I hope someone here can help me.
I have a simple form in my website, it was working OK, after

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:
Code: $var = $_POST[variable];then i echo $var its what i

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how

FILTER_CALLBACK -- Files?
Hi All,

I'm using the php filter functions to validate my form data. For custom filters, I'm

Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak

xApp Analytics in BI 7.0
Dear all,

I am trying to implement xApp Analytics in BI 7.0. After I installed the analyt

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