Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 31st, 2007, 07:55 PM
NoNameNoWhere
Guest
 
Posts: n/a
Default How to keep <form> from re-submitting on page refresh...

I have forms that are handled by PHP scripts in the same file that
generates the page. After the page regenerates with the results of
the form submission, a refresh of the page re-submits the values of
the previous form. Is there a way to reset or clear that form data
to prevent the re-submission of data?

Thanks



  #2  
Old July 31st, 2007, 08:55 PM
Rik
Guest
 
Posts: n/a
Default Re: How to keep <form> from re-submitting on page refresh...

On Tue, 31 Jul 2007 20:49:29 +0200, NoNameNoWhere <noname@nowhere.com>
wrote:
Quote:
I have forms that are handled by PHP scripts in the same file that
generates the page. After the page regenerates with the results of
the form submission, a refresh of the page re-submits the values of
the previous form. Is there a way to reset or clear that form data
to prevent the re-submission of data?
Most simple solution is often do the thing you want with the posted data
in it on the receiving page (use PHP sessions if the data has to 'live
longer'), and redirect (with a proper HTTP header, not some javascript or
meta thingy) to another (or possibly the same page). Posts are 'lost' on
redirects, so no data will be resubmitted on refresh, the browser will go
straight to the page you provided.

As this is not really an HTML but PHP related issue (well, at least the
solution is), I've taken the liberty to post this answer to that group,
and set the follow-up to it.
--
Rik Wasmus
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles