path to include folder


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

Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of the path name when I'm including files, eg.

include $_SERVER['DOCUMENT_ROOT'] . '/site_name/includes/dbAdmin.inc.php';

Eventually when I upload the site to the hosting provider I'll need to remove the site name, ie.

include $_SERVER['DOCUMENT_ROOT'] . '/includes/dbAdmin.inc.php';

This is because the includes folder will be in the root directory.

This is going to be a real pain as I'd have to remove quite a lot of them, so I wondered if there was a way to avoid having to include the site name when testing or a workaround?

Appreciate any tips

No comments posted yet

Your Answer:

Login to answer
336 Like 5 Dislike
Previous forums Next forums
Other forums

Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

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

Simpler method of getting variables from mysql
Hi Guys,

I'm trying to streamline my CMS's code and as I was writing a new page it occured to

How to form a xml form table with a single sql statement..?
Hi everyone,
I don't know if this is going to be a duplicate thread but i couldn't

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

Renaming array keys
The issue: renaming array keys inside a foreach loop.

I'm trying to build a pie chart image w

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

scandir clients directory
hi,
how can i scandir the clients directory? i need a script that when i click a button it will u

Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:wampwwwlogspagesme

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