RE: [PHP] no-resubmit on reload/refresh

From: Date: Tue, 06 Mar 2001 13:00:47 +0000
Subject: RE: [PHP] no-resubmit on reload/refresh
Groups: php.general 
Request: Send a blank email to php-general+get-42743@lists.php.net to get a copy of this message
Javascript? (I know it's generally horrible, but it's good for this sort of thing) Stick this in your <head>...</head>: <script language="JavaScript" type="text/javascript"><!--Begin var submitcount=0; function jsCheck() { if (submitcount == 0) { submitcount++; return true; } else { alert("This request has already been submitted, please wait while it is processed."); return false; } } //End--></script> And call it from your form like this: <form name="myform" action="whatever" method="post" onSubmit="return jsCheck()"> Voila. HTH Jon -----Original Message----- From: Bruin, Bolke de [mailto:B.deBruin@tijdbeursmedia.nl] Sent: 06 March 2001 12:53 To: php-general@lists.php.net Subject: [PHP] no-resubmit on reload/refresh I have a form which is submitted by a POST action. After submitting, the same page (updated though) returns with the form. (It's a messageboard) Now when someone refreshes/reloads the page they get the question if they want to resubmit the form. I don't want that. You get double posts this way. I know it is possible to check the input for any duplicates, but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 (hope the id works) does it differently and your browser does NOT if you wnat to resubmit, it just doesn't do it. Anyone knows how this works (HTTP header maybe?) cheerz Bolke ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' **********************************************************************

« previous php.general (#42743) next »