<?php class Guard extends ArrayObject { public function offsetGet ($index) { return mysql_real_escape_string( htmlspecialchars( parent ::offsetGet($index) ) ); } } $_GET = new Guard(&$_GET); $_POST = new Guard(&$_POST); ?>