Well, I was wondering, is it possible to have a "dynamic" switch statement?
kinda like...
(this doesn't work btw)PHP Code:<?php
$allowed = array('codedb', 'members', 'forums', 'content');
switch(strtolower($_GET['section']))
{
foreach($allowed as $rd)
{
case $rd:
include $rd.'.inc.php';
break;
}
}
?>
I guess there's always the possibility of writing it to the included file, but that' d be a pain in the butt, but it'd work, no?
Gimme your thoughts on this.


LinkBack URL
About LinkBacks






Reply With Quote


