note 36762 deleted from function.include by sniper

From: Date: Tue, 04 Nov 2003 00:43:16 +0000
Subject: note 36762 deleted from function.include by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59802@lists.php.net to get a copy of this message
Note Submitter: catsdorule@68kmla.org ---- A simple way to make a easy to manage website would be to do the following: <? if (empty($_GET["page"])) { $page_name = 'pages/default.php'; } else { $page_name = 'pages/' . $_GET["page"] . '.php'; } ?> <html> <head> <title>Dynamic Include Example</title> </head> <body> <!-- Title --> <p>Dynamic Page Example</p> <p><a href="?page=1">1</a> <a hred="?page=2">2</a></p> <hr /> <!-- Dynamic Include --> <? include($page_name);?> <hr /> </body> </html> Now create the directory 'pages' and 3 documents in side it labeled, '1.php', '2.php', and 'default.php'. Finally make shure they do not have any <html><head> and <body> tags in it, just the content.

« previous php.notes (#59802) next »