I use this:
function safeClean($n)
{
$n = trim($n);
if(get_magic_quotes_gpc())
{
$n = stripslashes($n);
}
$n = mysql_escape_string($n);
$n = htmlentities($n);
return $n;
}
To prevent any type of MySQL input or something like that. Whenever I use it to wrap around $ _POST, do the following:
$username = safeClean($_POST['user']);
$password = md5(safeClean($_POST['password']));
$vpassword = md5(safeClean($_POST['verify']));
$email = safeClean($_POST['email']);
It doesnβt even work, but I connected the .php functions, and the directory is correct, but it doesnβt work at all, because it just shows a blank page ... If I remove safeClean () from every $ _POST it works.
Why does this not work at all?
source
share