PHP Includes
At the moment in my spare time during my GCSE’s. Only a true geek would take time to learn a server-side scripting language. In this case PHP (PHP, Hypertext, Processor). The term “server-side” means that, quite ironically that its a programming language or script that remains on the server and therefore not accessible on client side computers except for javascript which is something usually enabled in the browser and can be seen if you view the page source.
There are a number of uses of PHP which are valuable to web designers and so on. Which include “includes” which I’ll use as an example for how it can be used. (Oh and if you want to learn PHP you need it to install it first, which can be really complex. So I would suggest you download XAMPP which is a package put together which will install Apache, Perl, MySQL and PHP on your computer safely and comes with a neat control panel where you can turn on and off any part of XAMPP.

So anyway, Back to PHP. We’ll now make an example of how includes can be used to your advantage when creating a website. Lets create a simple HTML document.

Save this as “index.php” then create another file. lets say a footer for a site. So go and create a file called “footer.php” and make a small footer.

Then lets add in the PHP to integrate the footer into the index file.

And as we can see from the preview in my code editor, we have sucsessfully included the footer content into the index page using the include function in PHP.

Why is this useful? It wouldn’t appear useful in this example as it actually complicated things more than they should be. But on a larger website with multiple pages. Includes will be more efficient that typing out the same code for a footer or a navigation bar time and time again.
I hope this tutorial was useful and if you have any questions feel free to contact me at the bottom of the page.
There are a number of uses of PHP which are valuable to web designers and so on. Which include “includes” which I’ll use as an example for how it can be used. (Oh and if you want to learn PHP you need it to install it first, which can be really complex. So I would suggest you download XAMPP which is a package put together which will install Apache, Perl, MySQL and PHP on your computer safely and comes with a neat control panel where you can turn on and off any part of XAMPP.

So anyway, Back to PHP. We’ll now make an example of how includes can be used to your advantage when creating a website. Lets create a simple HTML document.

Save this as “index.php” then create another file. lets say a footer for a site. So go and create a file called “footer.php” and make a small footer.

Then lets add in the PHP to integrate the footer into the index file.

And as we can see from the preview in my code editor, we have sucsessfully included the footer content into the index page using the include function in PHP.

Why is this useful? It wouldn’t appear useful in this example as it actually complicated things more than they should be. But on a larger website with multiple pages. Includes will be more efficient that typing out the same code for a footer or a navigation bar time and time again.
I hope this tutorial was useful and if you have any questions feel free to contact me at the bottom of the page.