Ok quick question. I am sending errors through URL in intergers only
(../index?err=4)
then when it gets there I am filtering that error with
$errorget = filter_input(
INPUT_GET, 'err', $filter = FILTER_SANITIZE_NUMBER_INT
);
I then use a switch to select appropriate echo.
switch ($errorget) {
case "4":
$error = 'Error1';
break;
case "61":
$error = 'Error2';
break;
case "33":
$error = 'Error3';
break;
case '51':
$error = 'Error4';
break;
default:
$error = null;
}
echo $error;
Ok so, is this a safe method and is there a vulnerability with this way to help avoid XSS?
Thank you in advance.