Jump to content

Warning: Page has Expired


orange08

Recommended Posts

Are you posting data from a form to a script? Because if you are and you try to go back to that page IE may prevent your page from initially displaying, unless you confirm you want to post the data again.

 

yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again...

yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again...

 

To prevent it you can do a header redirect to a "thank you" page. Doing this redirect will clear the POST data.

yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again...

 

To prevent it you can do a header redirect to a "thank you" page. Doing this redirect will clear the POST data.

 

ya, currently after the form is submitted, then it'll be redirect to the main page. my problem is sometimes user press the 'back' button, intend to get back the form again, that's why the problem arise...

If you do a header redirect immediately after the form is submitted, it should wipe clean the data from POST.

 

Something like this:

 

<?php
$action = isset($_GET['action'])?trim($_GET['action']):'index';
$action = strtolower($action);

switch ($action) {
    case 'input':
           // enter data here
          header('Location: page.php?action=thanks');
    break;
    case 'thanks':
           echo "Thank you for submitting data.";
    break;
    default:
    case 'index': 
           echo 'Please fill out the form and click submit';
    break;

}
?>

 

A simple example, but that should clear the post data for when a user clicks back.

If you do a header redirect immediately after the form is submitted, it should wipe clean the data from POST.

 

Something like this:

 

<?php
$action = isset($_GET['action'])?trim($_GET['action']):'index';
$action = strtolower($action);

switch ($action) {
    case 'input':
           // enter data here
          header('Location: page.php?action=thanks');
    break;
    case 'thanks':
           echo "Thank you for submitting data.";
    break;
    default:
    case 'index': 
           echo 'Please fill out the form and click submit';
    break;

}
?>

 

A simple example, but that should clear the post data for when a user clicks back.

 

please forgive my ignorant, may i know what $_GET['action'] meant? it's from my submit button?

It was just a rough example. Basically it is a way to execute different code on the same page.

 

It does not "have" to be setup that way. What I am getting at, is after your code processes from the submit button do an immediate header redirect and it should take care of the going back and re-posting the data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.