HTTP Query String Parameters Guard

Submitted by nezarfadle - 7 years ago

Protect and Guard the HTTP Query String Parameters

Have you ever wanted to Guard your HTTP Query String Parameters and prevent the user from manipulating them!?

Example:

$limit = $req->query('limit', 10);

http://localhost:8000/users?limit=1  - $limit = 1
http://localhost:8000/users?limit=5  - $limit = 5
http://localhost:8000/users?limit=11 - $limit = 10

Here is how you can do so:

https://gist.github.com/nezarfadle/02e09918d4378c0369307a07a2943884