dongra1984 2013-01-09 13:03
浏览 22

具有过滤参数的分页产品

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?

  • 写回答

1条回答 默认 最新

  • donglian4770 2013-01-09 13:23
    关注

    I prefer to use POST and save parameters information inside hidden inputs, the problem with SESSION is that if an user closes the browser/tab and goes back it will be where it was instead of the beginning.

    Also, if you use the same params in another module (like page=6) of the website it could show another results at page 6 instead of the first one.

    评论

报告相同问题?

悬赏问题

  • ¥15 vscode的问题提问
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM