if(!get_magic_quotes_gpc()) { $_GET = daddslashes($_GET); $_POST = daddslashes($_POST); $_COOKIE = daddslashes($_COOKIE); $_FILES = daddslashes($_FILES); } function daddslashes($string, $force = 1) { if(is_array($string)) { foreach($string as $key => $val) { unset($string[$key]); $string[addslashes($key)] = daddslashes($val, $force); } } else { $string = addslashes($string); } return $string; }