Results 1 to 4 of 4

Thread: bet ya cant figure this one out!!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    Lightbulb bet ya cant figure this one out!!

    Scenario.

    User fills out form, clicks submit,
    Users is take to page to review data they entered.
    User clicks finalize and is taken to thank you page.

    Question.

    If the user clicks back after getting to thank you. How can I totaly expire the page so that clicking reload or back wont bring the origional page back up. IE/Mozilla/Etc.. give (Page Expired) error when this is done. Many sites do this for security andIT CAN BE DONE!.

    Anyone know how?

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Add these lines to the top of the page you want to expire.
    PHP Code:
    header ('Cache-Control: no-store, no-cache, must-revalidate');
    header('Cache-Control: post-check=0, pre-check=0'false); 
    In Internet Explorer it displays the PAge Has Expired message when the Back button is clicked.

    In netscape it reloads the page. You can then use a PHP script to echo a message back to the user to tell them they cannot go back.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    what??? that isn't security. it is called the session has timed out and you need to reload the page.

    sure that may work what visulad said but all you have to do is add a session. at the very top of the form page and the page they submit to add this

    <?
    session_start();
    rest of code here


    that way when they go back the form is reloaded by the user hitting refresh. it has nothing to do with security.

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Originally posted by visualAd
    Add these lines to the top of the page you want to expire.
    PHP Code:
    header ('Cache-Control: no-store, no-cache, must-revalidate');
    header('Cache-Control: post-check=0, pre-check=0'false); 
    In Internet Explorer it displays the PAge Has Expired message when the Back button is clicked.

    In netscape it reloads the page. You can then use a PHP script to echo a message back to the user to tell them they cannot go back.
    you forgot half the code and it doesn't work. look into the session_cache_limiter() in the php.ini file. and IE does not recognize Pragma: no-cache as that is an NS thing only

    PHP Code:
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
    header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT"); 
                                                        
    // always modified
    header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0"false);
    header("Pragma: no-cache");                          // HTTP/1.0 
    Last edited by phpman; Dec 31st, 2002 at 06:21 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width