How to sanitize your php input

Never trust user input, it may be malicious, always check your php input. Check all global arrays like $_GET, $_POST, $_REQUEST, $_COOKIE, allow only known variables and make sure that they contain the right type of data. What does this mean ? It means that if you have a $_GET[‘id’] variable in your script which …