Gewoon htmlentities()?
Kleine Vragen Topic #1
Dan krijg ik , maar ik wil hem zonder de
Dan heb je ergens addslashes() staan, of 2x mysql_real_escape_string() ofzo.
Lennard schreef:Ik zie dat hij al zo in de database gezet wordt.Dan heb je ergens addslashes() staan, of 2x mysql_real_escape_string() ofzo.
Maar dit gaat de database in:
$var = mysql_real_escape_string($_POST[new]); En meer niet...
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.
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.
Lennard schreef:magic_quotes_gpc OnWaar 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.
Klopt...
Dan maar me hosting mailen of stripslashes gebruiken.
hoi, ik beveilig mijn input tegen rare tekens zo:
hoe doe ik nu dat er wel punten (.) zijn toegestaan?
}
elseif($_POST["submit"] && !preg_match (/^[a-zA-Z0-9_-]+$/, $habbo))
{ hoe doe ik nu dat er wel punten (.) zijn toegestaan?
Waarom wil je je input tegen rare tekens beveiligen en waartegen wil je precies beveiligen?
al die dingen behalve punten
Waar is het voor dan?
Want volgens mij kan het een stuk handiger.
Want volgens mij kan het een stuk handiger.
Dat wat ik poste alleen met tekens
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]
?>
Ow, ik krijg ook , verkeerd gezien.Moet $_SESSION ook ge-escape-d worden? Zo nee, waarom niet?
Lees die posts van Lennard & mij hierboven.
Je moet dan eerst stripslashes() over je $_POST en $_GET waarden doen voordat je ze in de database stopt.
Lennard schreef:Denk dat ze een oude PHP versie of gare configuratie gebruiken, en magic quotes aan hebben staan.Waar is je site gehost?
Je moet dan eerst stripslashes() over je $_POST en $_GET waarden doen voordat je ze in de database stopt.
Overheen gelezen sorry.
Maar moet je $_SESSION ook escapen?
Maar moet je $_SESSION ook escapen?
Probeer het uit. 
