I want to integrate PHP into my design for a website so I don't have to manually go and change EVERY single page if I changed something in the header or the footer. Is anyone able to give me a simple rundown on how I can make the header call a certain file and the footer call a different file? I'd appreciate it!
Well, you'll basically want to create a "header.php" and "footer.php" file, then include them in your code where you want the contents of those files to show up using the php include code "<?php include("/path/to/includes/header.php") ?>" - pretty straightforward.
Thanks! I know that XHTML files usually have a declaring statement at the top, do I need to do anything like that with a PHP file? Also would I be able to save it as a .html file?
The <?php says the following is php code. and the ?> says this is the end of the php code. Note that the "" were added in the post above they are not used on your page and a ; was omitted. The actual line reads <?php include("/path/to/includes/header.php"); ?> If you already have pages that are indexed you should either make html server parsed to keep the extension or set up redirects to the new pages.
ah ok, thanks for the correction colby! I plan on having something up over the weekend, thanks for the help!