Re: quickform concept and redirect?
| From: | Alexey Borzov | Date: | Tue, 20 Jan 2004 11:08:21 +0000 |
| Subject: | Re: quickform concept and redirect? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10237@lists.php.net to get a copy of this message | ||
Hi!
Sebastian Ossio wrote:
I think I misunderstand the concept of quickform. I have seen the examples and allways wonder how you people redirect to the next side. Or don't you?We do.
I mean, when I make a form and process it I would like to get to a congratulations page, or have a next form, in my case I wan´t to redirect the user to the same page with an extra GET variable because I want to have more than one form in my page.Yes, this is the right approach. If you want to create multipage forms, I'd suggest looking at QF_Controller, or else you'll end up reimplementing most of its functionality.
But I cannot use a redirect after my process part because of the nature of Quickform. From what I understand quickform, reloads the page on submit, until it comes to the validation and then hopefully the process part, so in callback function on the process a redirect is not possible. Because unless I´m mistaken redirects only work when headers haven´t allready been sent. So what do you guys do after process? Do you all use just one page? or do you use Quickform Controller all the time?You misunderstood the behaviour. Every example provided with the QuickForm is done in such a way that it outputs *nothing* before the call to process() or display(). If you use the process() callback that doesn't output anything (and you usually use something that saves to the database) then you can easily redirect after the process() and exit.