Adding Repetitive Content Using PHP
To illustrate how powerful scripting like PHP can be for including content I am going to create a web page entirely from included files. In effect I will be creating the beginnings of a content management system. What you will see here you will see in systems like Wordpress and Joomla etc, however much more complex. The workhorse is a simple PHP include statement as you will see. What I am going to show is a simple web page split into three components
Here is the Index.php that pulls the pages in:
See how simple it is. Here are the three pages that it includes: header.php
Main.php
Footer.php
Here is what it looks like when you open the index.php page
Resources: |
|||||||||
|