PHP absolute path web root

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
martin-infj
-


Joined: 07 Nov 2005
Posts: 2

PostPosted: Mon Nov 07, 2005 11:01 am    Post subject: PHP absolute path web root Reply with quote

First of all I have no php knowledge, and me english is weak :)

I'm building a site that soon is going to have many pages. Headers, footeres and other repeating elements should be included with php or ssi. Initially ssi was ok but now I need to to run php scripts, so .php extension is required which as long as I understand doesn't allow to run ssi includes too at the same time.

So php includes will be used. The problem is that I'm testing now on my abyss, but later I'll have to upload all to the the apache server. If I could use an absolute path for the php includes it would be fun. I've just learned that php absolute paths start from the server root, not web root :( Which makes it impossible to use it. A relative path is a solution with ../../../blabla but eventually if I need to rearange dirs with pages I'l have to change many many (x5 includes per page)...

Basically - is there a way to make the absolute path to start from the web root? I found solution for apache (http://www.webmasterworld.com/forum92/1345.htm) but they don't apply to abyss since it doesn't have htaccess.

Can you suggest something?

Sorry for my huge post
Back to top View user's profile Send private message
martin-infj
-


Joined: 07 Nov 2005
Posts: 2

PostPosted: Mon Nov 07, 2005 11:45 am    Post subject: Reply with quote

I just found how to do it - <?php include("$_SERVER[DOCUMENT_ROOT]/blabla"); ?>

I would appreciate it if you share your knowledge with includes, relative/absolute paths and server changing. I'm afraid at a certain point it will be too late to make any changes.
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Mon Nov 07, 2005 5:44 pm    Post subject: Reply with quote

I'm confused, you want to include something from the document root?
Code:
include("/files/movies/CENSORED/incl.php");
//Say your docroot was in C:\htdocs, then that would be C:\htdocs\files\movies\CENSORED\incl.php
// Starting with a / designates starting from your docroot.

_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group