View previous topic :: View next topic |
Author |
Message |
martin-infj -
Joined: 07 Nov 2005 Posts: 2
|
Posted: Mon Nov 07, 2005 11:01 am Post subject: PHP absolute path web root |
|
|
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 |
|
 |
martin-infj -
Joined: 07 Nov 2005 Posts: 2
|
Posted: Mon Nov 07, 2005 11:45 am Post subject: |
|
|
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 |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Mon Nov 07, 2005 5:44 pm Post subject: |
|
|
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 |
 |
 |
|