Anti SQL Injection SCRIPT
:: GotMedia | World Of Design :: :: WebDesign :: Scripturi
Pagina 1 din 1
Anti SQL Injection SCRIPT
- Cod:
[color=#000000][color=#FF8000]// Anti-SQL Injection
[/color][color=#007700]function [/color][color=#0000BB]check_inject[/color][color=#007700]()
{
[/color][color=#0000BB]$badchars [/color][color=#007700]= array([/color][color=#DD0000]";"[/color][color=#007700], [/color][color=#DD0000]"'"[/color][color=#007700], [/color][color=#DD0000]"""[/color][color=#007700], [/color][color=#DD0000]"*"[/color][color=#007700], [/color][color=#DD0000]"DROP"[/color][color=#007700], [/color][color=#DD0000]"SELECT"[/color][color=#007700], [/color][color=#DD0000]"UPDATE"[/color][color=#007700], [/color][color=#DD0000]"DELETE"[/color][color=#007700], [/color][color=#DD0000]"-"[/color][color=#007700]);
foreach([/color][color=#0000BB]$_POST [/color][color=#007700]as [/color][color=#0000BB]$value[/color][color=#007700])
{
if([/color][color=#0000BB]in_array[/color][color=#007700]([/color][color=#0000BB]$value[/color][color=#007700], [/color][color=#0000BB]$badchars[/color][color=#007700]))
{
die([/color][color=#DD0000]"SQL Injection Detected\n<br />\nIP: "[/color][color=#007700].[/color][color=#0000BB]$_SERVER[/color][color=#007700][[/color][color=#DD0000]'REMOTE_ADDR'[/color][color=#007700]]);
**
else
{
[/color][color=#0000BB]$check [/color][color=#007700]= [/color][color=#0000BB]preg_split[/color][color=#007700]([/color][color=#DD0000]"//"[/color][color=#007700], [/color][color=#0000BB]$value[/color][color=#007700], -[/color][color=#0000BB]1[/color][color=#007700], [/color][color=#0000BB]PREG_SPLIT_OFFSET_CAPTURE[/color][color=#007700]);
foreach([/color][color=#0000BB]$check [/color][color=#007700]as [/color][color=#0000BB]$char[/color][color=#007700])
{
if([/color][color=#0000BB]in_array[/color][color=#007700]([/color][color=#0000BB]$char[/color][color=#007700], [/color][color=#0000BB]$badchars[/color][color=#007700]))
{
die([/color][color=#DD0000]"SQL Injection Detected\n<br />\nIP: "[/color][color=#007700].[/color][color=#0000BB]$_SERVER[/color][color=#007700][[/color][color=#DD0000]'REMOTE_ADDR'[/color][color=#007700]]);
**
**
**
**
**
[/color][/color]
FlyToSky- Administrator
- Sex :
Zodiac :
Mesaje : 611
Reputatie : 10
Data nasterii : 02/09/1993
Data de inscriere : 23/12/2010
Varsta : 31
Localizare : Buftea
Joburi/Distractii : MuOnline & Marea Ieseala :)
Stare de spirit : Happy
:: GotMedia | World Of Design :: :: WebDesign :: Scripturi
Pagina 1 din 1
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum