Forum Moderators: coopster
My main concerns are any potential problems with search engines crawling these pages. Is there anything I should consider to make sure they find all the links in the header, since that's where my navigation bar will be?
If I'm going to use 3 or 4 includes on a page, each referencing a different page, is there still a need for include_once or require_once?
Anything else I should know about? Sorry about the newbie-ish question, but any insight one can lend would be fabulous. :)
for header and footer type includes I just use include as opposed to the 'once' functions. The once functions are great for including libraries but aside from that I don't worry about them.
>> anything else
remember that includes work on the file system and have no clue about your website structure. So you include files absolutely from the root of the server not the root of your website. I have seen this problem a lot.
another tip, you can make your sites more portable if you use $_SERVER['DOCUMENT_ROOT'] this means you won't have to swicth includes if you move servers.
example
if you have header.php located in the root of your site and need to include it through out your site you would do this
include '/example/public_html/header.php';
where the root of your website is located at /example/public_html/
but this is easier
include $_SERVER['DOCUMENT_ROOT'] . '/header.php';
same thing but the first would have to be changed if the location of your site's root changed