View Single Post
Old 04-17-2008, 04:30 PM  
PornGeneral
Confirmed User
 
Join Date: Sep 2004
Location: In front of computer
Posts: 564
Code:
$_POST = array_map('mysql_real_escape_string', $_POST);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
Code:
function clean($value){	
   if (get_magic_quotes_gpc()) {	
     $value = stripslashes($value);
   }
   if (!is_numeric($value)) {
     $value = mysql_real_escape_string($value);
   }

 return $value;
} 
array_walk($_GET,'clean');
array_walk($_POST,'clean');
array_walk($_COOKIE,'clean'); 
extract($_GET,EXTR_PREFIX_ALL,'get');
extract($_POST,EXTR_PREFIX_ALL,'post');
extract($_COOKIE,EXTR_PREFIX_ALL,'cookie');
Some old code I use to clean up so far no issues
__________________
"The object of war is not to die for your country but to make the other bastard die for his." -Patton
"Only the dead have seen the end of war." -Plato
PornGeneral is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote