0

I really tried to do this but I don't know what would be the best way.

I have a simple pagination system, with a "Previous" and "Next" buttons.

I want to preload the next or previous page in the listing ( https://stackoverflow.com/a/7830732/466318 ) according to the "path" the user is taking, by clicking "next" or "previous" button...

I tried to do it using SESSION but I need to pass the variable by clicking the link in the pagination, so I tried to pass it by GET.

The thing is that I have a lot of Rewrite Rules in .htaccess like:

RewriteRule ^populars/([a-zA-Z]+)/([0-9]+)$ /index.php?sec=popular&time=$1&page=$2

And I don't want to add another variable to the URL, and I don't know why but something like /popular/week/45?navigation=prev doesn't work. (I think it's because I didn't specify that variable in the rewrite rule)

Sorry if I'm making it more complicated than it is...

So, what could I use: SESSION, Cookies, GET or POST vars?

I just need to know if the user just clicked "next" so I can preload the next page, or the previous if clicked the previous link.

Community
  • 1
  • 1
Santiago
  • 2,405
  • 6
  • 31
  • 43

1 Answers1

0

you have a start- ^ and an end-condition $ in your regex. It simply won't match with your request. If it would, there would be ? twice

I would suggest to add a new Rule which include your navigation parameter.

Tobas
  • 351
  • 1
  • 6