As for number validation, here is a function I have used for some time. The number will then be zero if invalid, you check if its not zero before using the variable. It also removes , from a value, noticed when I logged the invalid data entered, that the most common was to copy paste number formated data, like the players money into the fields.
function validNumber($int = 0){
//If you want to support people pasting in formated numbers.
//If these two lines are removed, decimal numbers will be invalid (return 0)
$int = str_replace('.','',$int);
$int = str_replace(',','',$int);
if(empty($int) || $int < 1) return 0;
if (preg_match('[^0-9]',$int)){
//Invalid number entered
return 0;
} else {
return $int;
}
}
$_GET['id'] = validNumber($_GET['ID']);
This only checks if the data only contains 0123456789 and is not a negative number. It does in no way ensure that the value is the correct value, the user might have entered the wrong number.