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.

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

Is it a good practice to store user info. in sessions?
I am making a user class for my script which stores all the user information in sessions. It takes u

Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?

I found the following whil

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

Uploading/Downloading files stored in MySQL database
Hey all,

This problem just came up in my website and I'm having a hard time figuring out what

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

mysq_num_rows
Hi,

I want to use:

Code: if(mysql_num_rows($ergebnis2)==2)
how can the value 2, be

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

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