Sick of ending up with hundreds of static html pages? Well includes can help. Here is an example of how you can make your index page content dynamic.
Step 1) Make your layout with all menus and links on it.
Step 2) Place the snippet code in the spot where you want your content to go, probably in the middle of the site.
Step 3) Open up a new fresh php file and add hello world to it. Save the file as news.php.
Step 4) Open a fresh new php file and add this is the about page. Save the file as about.php
Step 5) Change two of your links on the layout page to this.
Home
About
Step 6) Save the 2 files and visit http://yousite/index.php
PS. you can continue to add pages to the snippet below just be sure to add the urls to your layout page.
<?
switch($_GET['id'])
{
default:
case "news":
include "news.php";
break;
case "about":
include "about.php";
break;
}
?>