...

View Full Version : Include Files



joesruddock
05-26-2011, 03:38 PM
Hi Guys,

Here is my code:


<?php
require($DOCUMENT_ROOT . "header.inc");
?>

How do I make this work one directory down?

e.g. www.domain.co.uk/products/HERE.php

Hope that males sense.

Thanks

Joe

Inigoesdr
05-26-2011, 03:40 PM
Assuming $DOCUMENT_ROOT is the actual document root, and header.inc is there, it should work.

joesruddock
05-26-2011, 03:42 PM
I have all the includes in the root of the file. But then I want to attach the same include one directory below. Does that make sense?

tomharto
05-26-2011, 04:11 PM
Do you mean the file is in a parent folder? IE you need to go up a level to get the the file you wanna include? If so just put ../ before e.g. include("../header.inc");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum