Basic Question Regarding PHP Includes


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

Hi

Just starting out with PHP.

Did you know?Explore Trending and Topic pages for more stories like this.
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

Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don'

How to sum these output values
Hi

I need sum the month totals
SELECT region_name, area_name ,SUM (CASE WHEN S

Which practice of iteration through containers is preferred
In the "real world" what kind of loop do most people use to iterate through a container like a vecto

Getting number of affected rows in SQLPLUS..
Hi everyone,
I have a shell script where i am invoking sqlplus, running a query and saving t

Simple image grab script.
I was wondering if it was possible and if anyone knew how to make a simple php script that looks at

Passing an array of values From VB6.0 to Oracle PL/SQL Function
Basically we are using VB6.0.

When we try to pass an array from VB6.0 to an Oracle PL/SQL

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

losing variables between php brackets
Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

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