Yes, you need to have a code which stops bad stuff being saved in your database
Code:
function EvClean($string){
if(get_magic_quotes_gpc()){
$string = stripslashes($string);
}elseif(!get_magic_quotes_gpc()){
$string = addslashes(trim($string));//strip your slashes, or add them to break any injections.
}
$string = escapeshellcmd($string);//escapes all inputs and prevent php shell commands
$string = mysql_real_escape_string($string); //strips all mysql injection attempts
$string = stripslashes(strip_tags(htmlspecialchars($string, ENT_QUOTES))); //removes all html special tags
return $string;
}
$message = EvClean($_POST['message']);
echo $message;
This code is good to deal with
Bookmarks