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

336 Like 5 Dislike
Previous php-forum Next php-forum
Other php-forum

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP th

script and html conflict in trying to create a header.
I have an error is occurring because of an html webpage with a "php require" at the top of

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

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