PHP保存页面然后重定向到上一页(ajax)
I would like to ask for how to redirect to previous page (ajax paging).
Example, Let's say currently I am in page 5, then I click on one record, after I edit it, I would like to go back to that page 5 not page 1.
The problem is my paging is using ajax,
I try to use $_SERVER[http_referer], but I only get http://domain/photo , I not able to get # and the value.
What is the best way to redirect back to the previous paging. My last choice is using $_SESSION. Hope I can get better answer here.
Thx.
我想问一下如何重定向到上一页(ajax分页)。 p> \ n
示例, 如果我现在在第5页,然后点击一条记录,在我编辑之后,我想回到第5页而不是第1页。 p>
问题是我的分页使用了ajax, p>
我尝试使用$ _SERVER [http_referer],但我只得到 http://域/照片,我无法获得#和值。 p>
重定向回上一次分页的最佳方法是什么 。 我的最后一个选择是使用$ _SESSION。 希望我能在这里得到更好的答案。 p>
Thx。 p> div>
Like Lauri says, you need to manage this at the client-side using Javascript. Basically you need to implement some sort of client-side browser history. Just look at how Facebook loads in photos, but still lets you use the back button.
There are various libraries available to help you: