Resources
This tutorial was generously donated by Nebula-Studios.net.
This is a sequel to the easy templates tutorial. This tutorial is more efficient than the easy templates tutorial, as the need to add an if() statement for each page is eliminated. Continue reading for more information.
Place the following code at the top of your PHP file.
<?
if(!isset($_GET['p'])) {
$p = 'front';
}
?>
This defines what file to include if none is specified, this is for our homepage.
Insert this code where you would like your content to appear...
<?
include("$p.php");
?>
This will include the file that you specify in the URL. Eg. 'index.php?p=gallery', would include gallery.php
This way you don't have to add another if statement for each new page that you want to link to.
This tutorial was generously donated by Nebula-Studios.net.
This is a sequel to the easy templates tutorial. This tutorial is more efficient than the easy templates tutorial, as the need to add an if() statement for each page is eliminated. Continue reading for more information.
Place the following code at the top of your PHP file.
<?
if(!isset($_GET['p'])) {
$p = 'front';
}
?>
This defines what file to include if none is specified, this is for our homepage.
Insert this code where you would like your content to appear...
<?
include("$p.php");
?>
This will include the file that you specify in the URL. Eg. 'index.php?p=gallery', would include gallery.php
This way you don't have to add another if statement for each new page that you want to link to.
This tutorial was generously donated by Nebula-Studios.net.

