View Single Post
Old 18.08.2005, 16:34   #6
BiGBoY
Архивный участник
 
Join Date: May 2005
Posts: 216
Default

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]
BiGBoY is offline