PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello.
I am developing a dynamic bread crumbs navigation system that was working fine until I came across the fatul "back and forward" that made it break.
SOS.
I was wondering if it possible to detect a Browser Back/Forward by PHP.
I mean. I am in page A, I go to page B and then I click on the Back button and I return to A.
Does it exist a php function that detect that I have used the Back button?
Thank you very much
Sahaja
Last edited by sahaja108 on Mon Nov 13, 2006 9:56 am, edited 2 times in total.
the problem is more complicated than what i depicted!
after your advice, i tested the system. practically, if i use Firefox and Explorer, the browser call the page from the server, but Opera not!
i have used a
echo rand();
and it returns different values for FF and IE when a i go back and forward, but the same value ion Opera!
You cache control settings can have an impact on what the browser does on back/forward. If it is that big of an issue, you should find ways to code your app so that back/forward are handled at the page load.
yes, maybe i need to intercept the event back/forward at client level and then send a msg to the server what is requested a back page...
i used a session array to keep track of the dynamic breadcrumbs. the difficult with this navigation is that there are many paths leading to a same page. so i couldn't rely on a hierarchy.
but, anyway, it was working ... until i clicked on the back button: this event creats paths with funny directions.