SpiderLegacy
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Anti Sql'ing ..

2 posters

Go down

Anti Sql'ing .. Empty Anti Sql'ing ..

Post  Antoni Wed Apr 07, 2010 6:29 am

$sql_inject_1 = array(";","'","%",'"'); #Whoth need replace
$sql_inject_2 = array("", "","","""); #To wont replace
$GET_KEY = array_keys($_GET); #array keys from $_GET
$POST_KEY = array_keys($_POST); #array keys from $_POST
$COOKIE_KEY = array_keys($_COOKIE); #array keys from $_COOKIE
/*begin clear $_GET */
for($i=0;$i<count($GET_KEY);$i++)
{
$_GET[$GET_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_GET[$GET_KEY[$i]]));
}
/*end clear $_GET */
/*begin clear $_POST */
for($i=0;$i<count($POST_KEY);$i++)
{
$_POST[$POST_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_POST[$POST_KEY[$i]]));
}
/*end clear $_POST */
/*begin clear $_COOKIE */
for($i=0;$i<count($COOKIE_KEY);$i++)
{
$_COOKIE[$COOKIE_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_COOKIE[$COOKIE_KEY[$i]]));
}
/*end clear $_COOKIE */
?>


Thats the anti sql code page.

Your welcome
Antoni
Antoni

Posts : 53
Points : 78
Sl Rep : 3
Join date : 2010-04-07
Age : 28
Location : Brookyln, new york 11230

Back to top Go down

Anti Sql'ing .. Empty Re: Anti Sql'ing ..

Post  Guest Wed Apr 07, 2010 2:16 pm

Thanks a bunch Antoni. :]

Guest
Guest


Back to top Go down

Anti Sql'ing .. Empty Re: Anti Sql'ing ..

Post  Antoni Wed Apr 07, 2010 3:33 pm

Trevon wrote:Thanks a bunch Antoni. :]

I got a better one dont worry i will work on it.
Antoni
Antoni

Posts : 53
Points : 78
Sl Rep : 3
Join date : 2010-04-07
Age : 28
Location : Brookyln, new york 11230

Back to top Go down

Anti Sql'ing .. Empty Re: Anti Sql'ing ..

Post  KaoZ Sat Apr 10, 2010 4:04 am

Cool.
KaoZ
KaoZ
TerriBad

Posts : 77
Points : 95
Sl Rep : 0
Join date : 2010-04-08

Back to top Go down

Anti Sql'ing .. Empty Re: Anti Sql'ing ..

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum