View Single Post
Old 07-24-2008, 09:38 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by ncorpse View Post
Hi everyone

I'm working on a small php application that stores adresses in a mysql database. I'm using a class for printing HTML code.
So I need to include several files in several files
the problem is, that i cannot use absolut paths with require or include.
I tried to define a constant and use it like a document root.
PHP Code:
//define
define('DOCUMENT_ROOT','/var/www/tmp/');
//usage
require(".DOCUMENT_ROOT.".'dir2'); 
Can anyone show me off how I should manage my includes in a project?

Sry for my crappy english

ncorpse
try
PHP Code:
require(DOCUMENT_ROOT.'dir2'); 
DOCUMENT_ROOT without the quotes.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote