Hello,
I want to allow only numbers in $_GET method. I use this is in pagination to secure
$page = (isset($_GET['page']) && is_numeric($_GET['page']) ? (int) $_GET['page'] : 1);
If I enter special characters or alpha, it returns error
This should not be possible:
index.php?page=AA and
index.php?page='!@#$%^&*()
Only this:
index.php?page=1 or 2 ...
Anyone has a solution for this? 🙂 thanks in advance…
I would suggest the use of
filter_input()