prevent hit the back button
Moderator: General Moderators
-
Chriss2004
- Forum Newbie
- Posts: 3
- Joined: Thu Sep 09, 2004 7:04 pm
prevent hit the back button
hello.
I have an admin section on my page where i use sessions.
i want to prevent the user to click on the back button of the browser.
i don't want to use cookies, and someone told me that I could use a table to store sessions. Add a dateTime or timestamp field in the table which is refresed everytime a user visits a page. Every page then checks if the user is logged in by getting the relevant record from the database and then check if the session has expired by check he date field.
I don't know how to do this.
Can sombody pls help (guide) me? I'm new to php, and this is kind of vital.
Or perhaps there are other options.
Thx
I have an admin section on my page where i use sessions.
i want to prevent the user to click on the back button of the browser.
i don't want to use cookies, and someone told me that I could use a table to store sessions. Add a dateTime or timestamp field in the table which is refresed everytime a user visits a page. Every page then checks if the user is logged in by getting the relevant record from the database and then check if the session has expired by check he date field.
I don't know how to do this.
Can sombody pls help (guide) me? I'm new to php, and this is kind of vital.
Or perhaps there are other options.
Thx
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
viewtopic.php?t=23781 may help with database sessions.. try searching next time, please.
as for preventing backward walking, you can't effectively.
as for preventing backward walking, you can't effectively.
untill now, http://www.tonymarston.net/php-mysql/ba ... s.html#how is the easiest (and best working) solution i've seen 
You could use javascript to open a new window on each link and close the old one in the process. As you always got a new window you have no back history.
Note: You can only close windows that you opened yourself. So the initial browser window the user comes in with can't be closed.
This of course only works when javascript is enabled.
Note: You can only close windows that you opened yourself. So the initial browser window the user comes in with can't be closed.
This of course only works when javascript is enabled.