SQL Injectie check

Gestart doorIlyasftw15 reacties25 weergaven

16 berichten · pagina 2 van 2

Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
Eerdere citaten tonen
Nielsjojo schreef:
Geef je na de check ook tips om het te beveiligen zodat het script SQL Injection proof wordt?
Wat heb je er anders aan...? Dat hij enkel zou checken en je zou zeggen dat die veilig was of niet aah
Weet ik veel, straks komt ie aan met hij NIET of hijs WEL SQL Injection proof en daar heb je als dat niet zo is veel aan emo
toevoeging op 19 juli 2012, 20:42:33:
Smiegles code met Cookie en Sessie beveiliging:

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren