RE: [PHP] Quick Question
| From: | John W. Holmes | Date: | Wed, 07 May 2003 01:17:01 +0000 |
| Subject: | RE: [PHP] Quick Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146608@lists.php.net to get a copy of this message | ||
> > I have a quick question. Currently, I have a form embedded in some
> > html code
> > that goes to another page when the user clicks submit. On this other
> > page, I
> > update the database and perform some other operations. When I am
done
> > on
> > this page, how do I get back to original form page so the user can
> > fill out
> > another form.
>
> Or you could just create one page like this:
>
> if (isset($_POST['submit])) {
> // Handle the form.
> }
> // Display the form.
>
> It will automatically handle the submitted form and then redisplay it.
Just be aware that with this method, you run into the refresh problem.
People hitting refresh will cause the form to be submitted again or
they'll be asked it they want to submit it again. You can use this
method and actually redirect back to the same page, thus clearing the
POST/GET variables, so the refresh just refreshes the form page...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/