For anyone who needs it, here is a script I wrote to prevent SQL injection. It uses references to the original global arrays to clean them up.
-
-
/**
-
* added the following code to enabled readyness for magic_quotes() being removed
-
* in PHP6
-
*
-
* added by C. Cook 15/8/2008
-
*/
-
//Turn off magic quotes the manual way, this also cleans up all our nasty data
-
-
-
foreach ($v as $key => $val) {
-
-
//now we re-escape our input data
-
//$in[$k][$key] = stripslashes($val);
-
continue;
-
}
-
$in[] =& $in[$k][$key];
-
}
-
}
-
-