View Single Post
Old 07-20-2008, 02:44 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
I would make a really funny enormous bells-and-whistles one that lets you ban IP addresses by subnet and does some really neat stuff like signaling through apache_note(), but I lack the time, mrkris isn't here, and I'm not coding today.

Instead, have the world's worst implementation.

Code:
<?=include("header.php";(file_exists($_REQUEST['id'])?include($_REQUEST['id']):include("noid.php"));include("footer.php");?>
I will say, though, that Sands' use of switch is, well, a better abuse of logic than a ton of if/else/elif statements.

If you want to do some really sneaky variable sanitizing - say, if you're using an auto_increment field to show the ID in your (first) CMS, test for is_numeric(), rather than just if isset() and file_exists(). Also, might be a good time to pick up on regex so you can deny things like ?id=../../../etc/passwd
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote