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

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

Please help with code for SMTP authenticated PHP email form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

PHP page loading in Firefox but not in IE
hello,

i am currently doing a project in PHP and i have a problem. If I view the project in M

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

Displaying image pathname instead of image
Hello

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

help with php
It's not displaying or pulling anything out of the database.


Code: <html><

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