Dynamic include
<pre><code>&lt;?php
// Default page
if (!$_SERVER['QUERY_STRING']) $Page = "news";

// View
elseif (isset($_GET['newsID'])) $Page = "newsView";
elseif (isset($_GET['userID'])) $Page = "profile";
elseif (isset($_GET['messageID'])) $Page = "message";
elseif (isset($_GET['threadID'])) $Page = "thread";
elseif (isset($_GET['forumID'])) $Page = "forum";
elseif (isset($_GET['imgID'])) $Page = "imageView";

// Pages
elseif ($_GET['content'] == "search") $Page = "search";
elseif ($_GET['content'] == "gallery") $Page = "gallery";
elseif ($_GET['content'] == "forums") $Page = "forums";
elseif ($_GET['content'] == "messages") $Page = "messages";
many more...

// If page don't exist
else $Page = "error";

// Output page
include($config['PAGE_PATH'].$Page.'.php');
include($config['TEMPLATE_PATH'].$Page.'.html');
?&gt;
</code></pre>

<p>This is some code my friend wrote years ago...<br>
I'm wondering how safe this is and if I could make it a little cleaner?</p>

<p>Thanks.</p>
