Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clearing form post values on a page refresh

Status
Not open for further replies.

Trusts

Programmer
Feb 23, 2005
268
US
Hi,

I'm trying to find a way to clear the values being included with a form's post.

The form posts back to its own page. I need to keep it this way due to other needs of the client.

Also it is post, not get. That has to stay too.

Within the php code, certain messages are echoed to the screen depending on the value of the form inputs. That's fine. When I refresh the page, the messages still appear - must be that the inputs have not cleared. I tried using unset, sessions, etc. but can't seem to get the messages to be blank on a page refresh. I didn't know if there is some other php statement I could be using to clear them?

Thanks,
KB
 
a refresh resubmits the form. thus the values are also 'refreshed'. you need to find a way to check whether the form has already been submitted. i have posted such a method before. you can find it here:
 
You could try
Code:
$_POST = array();

Although, it sounds more like it's using the $_SESSION array.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top