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

Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on decid

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of infor

Looking for help on using joining mysql tables and php....
Does anyone have any good links to references on how to pull mysql data, through joining tables and

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum

problem with script manager
Hi iam using Net.2005.I have created ajax enabledwebsite.i have master page in which i have script m

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