PDA

View Full Version : Don't use Iframe



Jack.
19-09-2010, 03:13 PM
This is aimed at the people who use Iframes. Don't use them because they suck and are annoying. put this code in your main content area:



<?php
$page = $_GET['page']; // page is like ?page= if changed to smile it would be ?smile=
$folder = ""; // Folder in which all the content is
$extension = ".php"; // File Extension
$setup = $folder . "" . $page . $extension; // All of it put together

if (isset($page))
{
if (is_readable($setup))
include ($setup);
}
else
include($folder . "home.php"); // Main Page
?>

All you have to do is replace "home.php" with whatever your main page is and then make all your links go "index.php?page=PAGENAME" and if you have other content boxes then just put
<?php include("PAGENAME.php"); ?>

Also Note: All pages must be .php otherwise they won't execute.

Mikey_XD
19-09-2010, 05:42 PM
Actually there is nothing wrong with iframe if you use it properly.

Jack.
19-09-2010, 06:39 PM
I was just posting an alternative.