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

error reporting
hey everyone

I have a production server in which I want error reporting but only on some page

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Creating web pages by php
Hello again,
I was just wondering us there a way to use a php script to create a new web page. I

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

I have a parse error in this query help..
Code: $query1="INSERT INTO `rating` (`item_name`, `rating`, `ip_address`, `date_rated`) VALUES

PHP Code To Change Font Color in Table Cell
I would appreciate help with the following snippet of my php code. I am just trying to change the f

Passing variables with pagination - iterating through unique id per link
Hi everyone,
I have seen a few topics like this one. Still cant find the specific thing, so I am

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

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