View Full Version : easiest way to reuse a file?

03-19-2007, 03:07 AM

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???


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

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

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

03-19-2007, 05: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