refresh button will mail the form again.

From: Date: Wed, 09 Apr 2003 04:15:41 +0000
Subject: refresh button will mail the form again.
Groups: php.general 
Request: Send a blank email to php-general+get-142995@lists.php.net to get a copy of this message
Dear Sir, I am new to PHP, currently I just built a form and mail the result to myself as: in mailform.php: <?php if ($_POST['action'] == 'submitted') { /* mail the form */ } else { } ?> in form.php: <form action="mailform.php" method="post"> Name: <input type="text" name="personal[name]"><br> Email: <input type="text" name="personal[email]"><br> <input type="hidden" name="action" value="submitted"> <input type="submit" name="submit" value="submit me!"> </form> I am using PHP 4.3.1 with Apache, it works fine, but if I use the refresh button on the browser, it will send the form again even I tried $_POST['action'] = "FALSE". Could you please tell me what I could do to prevent it from sending mail again? Or, just discard the form data? Thanks a lot. Really appreciate any help as I only know PHP for one week. TG

« previous php.general (#142995) next »