How to create a well structured website using PHP and include function (1 header and footer file)
In this example i’m going to show you how to create a very simple and easy website using PHP and the PHP Include function. This is a great way to create your website because you only need to have one header and one footer file! This is how i structure almost all my websites because think about it, if you need to change an image, a link, or even a typo, if you are using regular HTML files you have to edit each one individually! This will show you how to save yourself a LOT of time!
First thing you will need is a host, if you do not have one you can get a free account from Host Tornado at http://www.hostt.net.
1 2 3 4 5 6 7 8 9 10 11 |
< ?php $page = $_GET['page']; include('includes/header.php'); if ($page == "") { include('includes/home.php'); } elseif($page == "contact") { include('includes/contact.php'); } include('includes/footer.php'); ?> |