473,326 Members | 2,588 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,326 software developers and data experts.

disable backbutton - when page has expired...

Hi!

I have this on the page:
<?php
header("Pragma: no-cache");
header("Expires: -1");
?>
but I want it so, that when the user goes back, (s)he might not be
allowed too - say the session has expired.

How can i achive that?

BR
Sonnich

Aug 22 '07 #1
1 2297
On Aug 22, 2:45 pm, jodleren <sonn...@hot.eewrote:
Hi!

I have this on the page:
<?php
header("Pragma: no-cache");
header("Expires: -1");
?>

but I want it so, that when the user goes back, (s)he might not be
allowed too - say the session has expired.

How can i achive that?

BR
Sonnich
Generally what you're describing is something you want to avoid
whenever possible. Breaking the back button is generally bad for
usability and confusing for the user. However, if you feel that it is
entirely necessary to do, probably the best thing you can do, is set a
session variable when the user goes to the first page, and then modify
it on the second page in some way to indicate they've been to that
second page. Have a check on the first page, that looks for the
session variable and does some checks on it to ensure that the user
hasn't visited the second page. Maybe something like this:

//page1.php

if(isset($_SESSION['page_token']) && $_SESSION['page_token']) ==
"beentosecondpage"){
//stop script execution, or present user with alternative content
}

Aug 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
4
by: John | last post by:
Could anyone please help me on this?? I have a php script page, which is basically quiz. Visitors (after login in with their email address) are supposed to answer each question, and when they...
16
by: Dave Smithz | last post by:
Hi, In summary: I want to a form to submit information via a HTTP POST, however, when using Internet Explorer I want to be able to use the back button and all the information retained....
1
by: Stuart Wexler | last post by:
Hi, I have a GUI followed by a CFM processing page, followed by an ASP processing page (don't ask) followed by a confirmation page. My problem is that the back button has it reprocess the same...
4
by: belgie | last post by:
Is there a way to prevent the user from using the browser Back Button to go back to a previous page in an ASP.NET application? Thanks! Bill
1
by: gatejs | last post by:
In IE. If you use the back button, the resulting page will execute the javascript in the page again: In Firefox, whatever value a variable had is kept when you go back to it: var i=0; //...
4
by: RedHair | last post by:
Development: Windows 2003 Production :Windows 2003 ASP.NET 2.0 + C# I want to disable the cache feature of all pages in dev but enable it in production environments. What's the solution? If...
1
by: hdotnetdev | last post by:
hi all i am using server upload control and other server controls. Once the page is posted back to server by any of other server controls, the page gets expired. So if i move to the page...
4
by: =?Utf-8?B?Rmxhc2hNZXJsb3Q=?= | last post by:
We're using C# & VS 2005. In our app ... someone is "logged-in" if Session("companyID") exists and is non-zero. How do we implement a "Logout" button that signs off session, sets...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.