View Full Version : dynamic includes

10-27-2003, 09:20 PM
Does anyone know of any tutorials that are similar to this one: http://www.hotscripts.com/Detailed/21358.html (the link to the actual tutorial doesnt work)
I tried searching but with no success. Thanks for any help.

10-27-2003, 09:25 PM
$pages = array();
$pages['start'] = 'a.php';
$pages['contact'] = 'b.php';
$pages['error'] = 'error.php';

if (isset($_GET['page']) && isset($pages[$_GET['page'])) {
require_once $pages[$_GET['page'];
} else {
require_once $pages['error'];

Call it like domain.tld/page=contact and there you go.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum