...

View Full Version : easiest way to reuse a file?



bear85
03-19-2007, 02:07 AM
Hey,

i'm redesigning my site and i want to create a header file once and just call it on every page. i tried using an include statement but when the file is inside another directory it seems to not work any more. for example if header file, and index file are all located in the home directory it works just fine. but when i code a sports gallery page that is located in a galleries directory, the header file doesn't work.

any suggestions as to how to make it work???

thanks

Inigoesdr
03-19-2007, 02:15 AM
Change the path? include('../header.php');

bear85
03-19-2007, 04:32 AM
Change the path? include('../header.php');

i've tried that but then it wouldn't work on the main page.

rafiki
03-19-2007, 04:49 AM
then change them depending on the directory... simple, if is in home directory usr include(page.php);
if its in a level above home user
include(../page.php);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum