I haven't been working with PHP for some time and now I have to solve a problem about statement of products with pagination and filtration (by price, by the newest ones etc).
This is my url example: web.com/category-name
- when I want to paginate products, I use for this purpose the $_GET
variable, like: web.com/category-name?p=2
.
Now to this basic pagination I would need to add parameters for filtration.
My first idea would be to send form as post
and the sent data for sorting save into the SESSIONS
and always check, if the parameters for filtration are in SESSION
and if they are, then I will filter products.
But I am not really sure that this solution is clean... I don't want to use GET
for filter parameters, because there is a lot of possible parameters...
Can I ask you, how would you solve this situation?