Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 55 van 286

Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Gewoon htmlentities()?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan krijg ik , maar ik wil hem zonder de
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dan heb je ergens addslashes() staan, of 2x mysql_real_escape_string() ofzo.
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Dan heb je ergens addslashes() staan, of 2x mysql_real_escape_string() ofzo.
Ik zie dat hij al zo in de database gezet wordt.
Maar dit gaat de database in:

$var    = mysql_real_escape_string($_POST[new]);


En meer niet...
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Waar is je site gehost?

Denk dat ze een oude PHP versie of gare configuratie gebruiken, en magic quotes aan hebben staan.

Je moet dan eerst stripslashes() over je $_POST en $_GET waarden doen voordat je ze in de database stopt.
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Waar is je site gehost?

Denk dat ze een oude PHP versie of gare configuratie gebruiken, en magic quotes aan hebben staan.

Je moet dan eerst stripslashes() over je $_POST en $_GET waarden doen voordat je ze in de database stopt.
magic_quotes_gpc On

Klopt...
Dan maar me hosting mailen of stripslashes gebruiken.
0
Jvdw

Lid

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hoi, ik beveilig mijn input tegen rare tekens zo:

}
elseif($_POST["submit"] && !preg_match (/^[a-zA-Z0-9_-]+$/, $habbo))
{


hoe doe ik nu dat er wel punten (.) zijn toegestaan?
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Waarom wil je je input tegen rare tekens beveiligen en waartegen wil je precies beveiligen?
0
Jvdw

Lid

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
al die dingen behalve punten
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Waar is het voor dan?
Want volgens mij kan het een stuk handiger.
0
Jvdw

Lid

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat wat ik poste alleen met tekens
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Jvdw schreef:
Dat wat ik poste alleen met tekens
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*        Gemaakt door dylanproductions.nl   */
/*        Veel plezier ermee!                 */
/*        Copyright by dylanproductions.nl   */[/COLOR]
[COLOR= #007700]function[/COLOR] sql[COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) {[/COLOR]                        
    [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);
}
                                        
function[/COLOR] xss[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700]) {[/COLOR]                        
    [URL="http://www.php.net/return"]return[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$xss[/COLOR][COLOR= #007700],[/COLOR] ENT_QUOTES[COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]// sql                                            [/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] sql[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]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] sql[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]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] sql[COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]);
}[/COLOR]  
[COLOR= #FF8000]// xss[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] xss[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]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] xss[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]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$key[/COLOR][COLOR= #007700]] =[/COLOR] xss[COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]);
}[/COLOR]  
?>

biggrinOw, ik krijg ook , verkeerd gezien.

Moet $_SESSION ook ge-escape-d worden? Zo nee, waarom niet?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lees die posts van Lennard & mij hierboven.
Lennard schreef:
Waar is je site gehost?
Denk dat ze een oude PHP versie of gare configuratie gebruiken, en magic quotes aan hebben staan.

Je moet dan eerst stripslashes() over je $_POST en $_GET waarden doen voordat je ze in de database stopt.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Overheen gelezen sorry.

Maar moet je $_SESSION ook escapen?
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Probeer het uit. smile
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