I have written this short function to protect against my_sql injection, because of its importance I just want to double check with other\'s that this will function as I inte
Tomas's suggestion is good, but you should always keep them both in mind, so this can be great:
if (get_magic_quotes_gpc()) { // Check if magic quotes are enabled
foreach($_REQUEST as $key => $value) {
$_REQUEST[$key] = stripslashes($value);
$_REQUEST[$key] = stripslashes($_REQUEST[$key])
}
} else {
foreach($_REQUEST as $key => $value) {
$_REQUEST[$key] = mysql_real_escape_string($value);
$_REQUEST[$key] = mysql_real_escape_string($_REQUEST[$key]);
}
}