Free Web Hosting Forum
Go Back   Free Web Hosting Forum > 000WebHost Services > Customer Assistance
Reload this Page How can I use $_SERVER['DOCUMENT_ROOT'] ???
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
coldsea2000 is on a distinguished road
 
Posts: 6
Join Date: May 2008
Exclamation How can I use $_SERVER['DOCUMENT_ROOT'] ??? - 05-30-2008, 10:37 PM

Hello,

I'd like to use the $_SERVER['DOCUMENT_ROOT'] php function
but It does not working...
I used like this :
<? include $_SERVER['DOCUMENT_ROOT'] .'/include/connect.php'; ?>

anybody know how should I do to use this function?

thanks!
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
dpaladin's Avatar
Senior Member
dpaladin is on a distinguished road
 
Posts: 703
Join Date: Apr 2008
Location: Lerdo, Durango, Mexico
Send a message via MSN to dpaladin
Default 05-31-2008, 12:17 AM

$_SERVER['DOCUMENT_ROOT'] is the directory of the actual script, so if you are running

yoursite.com/folder/script.php

$_SERVER['DOCUMENT_ROOT'] will be /folder/

but if you use a backslash before the file like:

/include/connect.php

the folder will be public_html

so please verify first where's your script connect.php


Freelance programmer

PHP - MySQL - Javascript - Ajax - XHTML

Plugins and templates for Wordpress

adn more..

Adding karma doesn't cost

No time for it, but:
http://dpaladin.com
Reply With Quote
(#3 (permalink))
Old
Junior Member
coldsea2000 is on a distinguished road
 
Posts: 6
Join Date: May 2008
Default 06-01-2008, 08:12 AM

I tried echo $_SERVER['DOCUMENT_ROOT'];
and it print this : /usr/local/apache/htdocs

I tried like include_once $_SERVER['DOCUMENT_ROOT'].'include/connect.php';
but it does not working..


How can I include the this file public_html/include/connect.php


Thanks^^

Last edited by coldsea2000; 06-01-2008 at 08:23 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com