Click to See Complete Forum and Search --> : how to handle missing $_POST parameters


davidklonski
03-31-2004, 08:35 AM
Hello

I have a page called 'test.php'

The page contains a form with method POST
here is the definition:
<form method="post" action="test.php">

As you see, the user submits the form to the same page the form was defined at.

Now, whenever I surf to that page directly, I get the following error message in the browser:

"The page cannot be refreshed without resending the information. Click Retry to send the information again, or click Cancel to return to the page that you were trying to view."

If I click Retry then everything is ok.

How can I detect in PHP that no information has been sent?

thanks in advance

solavar
03-31-2004, 10:00 AM
Are you saying that when you type the URL in the browser's address bar, the message appears?

In my experience, the only time that message appears is when I've hit 'Submit' and then tried to refresh the page which has already been submitted.

davidklonski
03-31-2004, 10:03 AM
Whe I type the URL in the address bar I get the following page:

Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.

shimon
03-31-2004, 10:32 AM
I guess IE must be sort of caching the posted version of the page...strange

errrr it's kind of weird behaviour though

you could always try
<form action="test.php/<?=time(); ?>">
then that way the post address gets timestamped, and the browser will think it's a seperate script

it might work..i dunno