Quote:
|
Originally Posted by nepsquare
... Just need to get the anti-sql injection part right...
|
[php:1:43c31b1d60]
function antiinjection($str) {
$banwords = array ("'", ",", ";", "--", " or ", ")", "(", " OR ", " and ", " AND ","/n","/r");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
$str = NULL;
}
$str = trim($str);
$str = strip_tags($str);
$str = addslashes($str);
$str = htmlspecialchars($str);
return $str;
}[/php:1:43c31b1d60]