Beveiligen

Gestart doorChristopher7 reacties63 weergaven

8 berichten · pagina 1 van 1

Christopher

Lid · Topicstarter

Berichten
7.757
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zoek beveiligings codes .. Hieronder heb je een lijst maar je kan er ook van jezelf geven

Lijst:

Anti Noscript
Anti Planetext
Anti doorstuur en iframe
Anti ... (geef de jouwe)
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
htmlentities($tekstuitdatabase)
0
Christopher

Lid · Topicstarter

Berichten
7.757
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog meer gezocht biggrin
ze voegen text via
$bericht = $_POST[aanbieding];
mysql_query("INSERT INTO aanbieding (id, aanbieding) VALUES (NULL, $bericht)");
?>
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon zo doen:

[COLOR= #0000BB]<?php
$bericht[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanbieding[/COLOR][COLOR= #007700]]));[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO aanbieding (id, aanbieding) VALUES (NULL, "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]


Htmlentities() beveiligt codes: , etc.
Trim() haalt spatie bij begin en eind eraf zodat je niet iets kan posten met alleen een spatie.
Mysql_real_escape_string() is voor database beveiligen wat je erin zet.

EDIT: had net een hele lap tekst nog bij gedaan, maar omdat het bewerk formulier anders is geworden drukte ik op annulerensadleyKijk anders even op w3schools.net (of .com) voor handige tutorialssmile
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Doe alsjeblieft dit. emo (Iets netter)

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO 
                         aanbieding 
                   (
                        aanbieding
                  )   VALUES (
                   "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanbieding[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"
                )"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
Doe alsjeblieft dit. emo (Iets netter)
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO 
                         aanbieding 
                   (
                        aanbieding
                  )   VALUES (
                   "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanbieding[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"
                )"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Dat vind ik persoonlijk onoverzichtelijk.
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jponsen schreef:
Eerdere citaten tonen
Shahiem schreef:
Doe alsjeblieft dit. emo (Iets netter)
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO 
                         aanbieding 
                   (
                        aanbieding
                  )   VALUES (
                   "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanbieding[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"
                )"[/COLOR][COLOR= #007700]);[/COLOR]
?>

Dat vind ik persoonlijk onoverzichtelijk.

Iedereen heeft zijn eigen methode.
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ja idd, dus waarom die reactie van jou?:
Quote:
Doe alsjeblieft dit.emo (Iets netter)

Ieder zijn eigen methode en dingetjes.
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