Hello, I'm trying to build my site with using includes, as to have separate files to be included for the head, navigation bar, footer, etc.
What is the best syntax, or form of include, or way of writing for this purpose?
Just to have index.html have various includes to files such as head.html, nav.html, footer.html etc.
Currently I'm using the following line everywhere I want to do this:
<?php include($_SERVER['DOCUMENT_ROOT']."/head.html"); ?>
Would you advise doing otherwise? Can you see any problems with this?
FYI: The index.html is just a regular file, containing info about the site (and of course I've turned on the function in htaccess so that php can be executed in html files), and all the files I'm including also have regular HTML, some will have some php, and Ajax (for forms), and one will be a blog page (probably with Wordpress).