Con gusto te paso una función que tengo en una de mis webs.
que por lo demas son muy atacadas jajaj (de juegos),
usalas y pasalas al que te las pida, todo sea por ayudar en algo. ^^
Código PHP:
Ver originalfunction check_inject()
{
$badchars = array(";","'","*","/"," \ ","DROP", "SELECT", "UPDATE", "DELETE", "drop", "select", "update", "delete", "WHERE", "where", "-1", "-2", "-3","-4", "-5", "-6", "-7", "-8", "-9",);
foreach($_POST as $value)
{
$value = clean_variable($value);
{
die("SQL Injection Detected - Make sure only to use letters and numbers!\n<br />\nIP: ".$_SERVER['REMOTE_ADDR']); }
else
{
$check = preg_split("//", $value, -1, PREG_SPLIT_OFFSET_CAPTURE
); foreach($check as $char)
{
{
die("SQL Injection Detected - Make sure only to use letters and numbers!\n<br />\nIP: ".$_SERVER['REMOTE_ADDR']); }
}
}
}
}
function clean_variable($var)
{
return $newvar;
}