Hell and Heaven Net
27/08 - 13 FF13 screenshots added! ¤ 21/08 - 35 FF13 magazine scans added! ¤ 20/08 - Release dates updated ¤ 03/08 - FF12 Movies page updated ¤ 03/08 - Site News system improved ¤ 30/07 - Final Fantasy XIII section updated ¤ 29/07 - New Poll added! results old poll ¤ 14/07 - Release dates updated ¤ 14/07 - Final Fantasy XIII E3 trailer added! ¤ 07/07 - Chrono Trigger DS trailer added ¤ 24/06 - Crisis Core voice actors info added ¤ 15/06 - New Affiliate: Square Anthology! ¤ 12/06 - Star Ocean: The Last Hope trailer added! ¤ 28/05 - FF9 Hints & Secrets page added ¤ 17/05 - FF9 Item list added ¤ 15/05 - 12 Crisis Core HQ FMV screenshots added! ¤ 13/05 - FF9 Blue Magic list updated ¤ 12/05 - Release dates updated ¤ 10/05 - 4 Grandia II movies added ¤ 27/04 - Added 3 PSF archives! ¤ 24/04 - Release dates updated ¤ 23/04 - FF10 OST info added ¤ 21/04 - FF9 OST info added ¤ 21/04 - Dropped 2 affiliates ¤ 20/04 - HHN Radio back online! ¤ 14/04 - Topsites back online!

This tutorials explains how to include pages with PHP that makes it easier to change pages and layout without have to edit all pages.

First you need to be sure that your host supports PHP, otherwise this tutorial is no use for you. Only a few free hosts support PHP. Contact your host for more information.

1) Make a layout in HTML and when you're done save it as a .php file (for this tutorial let's call it index.php.

2) Make a page with the content you want to include and save it. You can save it as a .txt file, but if you use php codes in the .txt file other people can see it. So it's better to save it as a .php file.

3) In the layout file place this code on the place you want the content to appear.

<?
$p = $_GET['p'];

if ($p) {
 if (file_exists("$p.php")) {
 include("$p.php");
} else {
 echo "404 Error - Page Not Found";
}
} else {
 include("page.php");
}
?>

You can change the 'p' into whatever you like, but be sure to change all 'p', otherwise the code won't work. Change page.php into your opening page file, like news/news.php for Fusion News.

4) Go to your browser and type: www.yourdomain.com/index.php?p=staff. staff stands for the name the content file has (staff.php) and 'p' is the variable. When you called your layout file index.php you can remove the index.php from the url, so it will looks like this: www.yourdomain.com/?p=staff.


There also a much easier way to include just one php file. The code is:

<?
 include("page.php");
?>

Just change page.php to the location where the file is stored that you want to include.

This ends the PHP include tutorial, if you have questions or need help with the code, you can send me a mail using the contact form.