I really hope you just subscribed, because this question already been
asked today...and yesterday... You should search the archive before you
Anyhow, the solution to your problem can be solved by using a
"processing" page that does the insert into the database and then
redirects to the main page that shows the list. The processing page
should not display anything at all, just do the insert and redirect.
Then the refresh will just refresh the page it was redirect to, and have
nothing to do with the processing.
> -----Original Message-----
> From: Rich Hutchins [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 17, 2002 9:49 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Resubmit on page refresh.
> I have a page that maintains a very simple list of items. The page
> current items on the list and provides an <input> field for the user
> new items to the list. Everything works great. The only problem I'm
> is that each time the user clicks the Refresh button on the browser, I
> that dialog box telling me "The page cannot be refreshed without
> information." Then the last value is added to the database again and
> and again each time the user hits the Refresh button. In know that's a
> browser "feature" that I can't control, but is there a way that after
> submitting the information to the database using the form and
> statements, I can unset the variables. I've already tried unset($sql)
> unset($variable), but to no avail.
> Here's the php code from the top of the page:
> if (isset($_POST["newStatus"]))
> $addStatusSQL="INSERT INTO status
> or die(mysql_error());
> Many wondrous things happen in here...
> And here's the form code from the bottom of the page:
> <form action="bookStatAdmin.php" method="post">
> <tr><td><input type="text"
> <tr><td> </td></tr>
> <tr><td><input type="submit"
> Any suggestions?
> Thank in advance.
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php