|
-
Dec 30th, 2002, 08:47 PM
#1
Thread Starter
Fanatic Member
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?
-
Dec 31st, 2002, 01:41 PM
#2
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.
-
Dec 31st, 2002, 06:09 PM
#3
Frenzied Member
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.
-
Dec 31st, 2002, 06:17 PM
#4
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|