473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How can I expire a page when a user clicks the refresh or back button of a browser?

How can I expire a page when a user clicks the refresh or back button of a browser using PHP?

Or how can we prohibit going back to the previous page when a user clicks the back button of a browser using PHP?
Oct 24 '12 #1
1 3379
PsychoCoder
465 Expert Mod 256MB
Well you cannot prevent using the back button with PHP, you can with JavaScript but all the user has to do is disable JavaScript to get around it.

You can use an approach like this to determine if the user has refreshed the page, if they have then use session_destroy() to end their session and redirect them elsewhere.
Oct 25 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Asit | last post by:
How can i know when user clicks X button of the browser ? I have to write some code when user clicks X button of browser. What is the event for capturing this event ? Help needed ASAP. Asit
2
by: Loke Kit Kai | last post by:
Hi, I would like to do the above, but have no idea how to... Any assistance is greatly appreciated. Kit Kai
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
0
by: BillE | last post by:
PROBLEM SUMMARY -- I use "Response.Cache.SetCacheability(HTTPCacheability.NoCache)" to force a page to reload instead of displaying cached content. However, I don't really want to reload the...
10
by: mjahabarsadiq | last post by:
I would like to reload the page when it is redirected by the browser's Back or Forward button. I tried the following but it does not works. <link rel="prev" href="url"> <link rel="next"...
3
by: gimme_this_gimme_that | last post by:
Depending upon a radio button button's setting a div is either hidden or visible. It turns out that the default view of the page requires that the div be hidden. When the user opts for the...
2
by: Jason | last post by:
I'm building a rich editor to replace a textarea, and am about to release it as "live." But there's one last thing I want to do with it. When using a textarea, if the visitor clicks on "back"...
4
by: PM ArunKumar | last post by:
i have two dropdown list in my form where the values in the list of second drop down changes based on the value i select in the first dropdown.(very similar to country and states list), here after...
1
by: swetha123 | last post by:
hello, Can any one please tell me I am Using php,Mysql,CSS to build my site In my database i have small images and large images i am show the small images to the right of the main container...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.