Re: PHP and GET/POST
| From: | Patrik Fomin | Date: | Mon, 08 Mar 2004 23:56:05 +0000 |
| Subject: | Re: PHP and GET/POST | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179842@lists.php.net to get a copy of this message | ||
great thanks =)
regards Patrick
"Chris Shiflett" <shiflett@php.net> skrev i meddelandet
news:20040308235448.518.qmail@web14306.mail.yahoo.com...
> --- Patrik Fomin <pafo@pafo.net> wrote:
> > How should you do it?, i mean i have 3 pages with some forms on two of
> > em First page = some general information to fill in Second page = more
> > deep informationand last page to confirm and store in the database.
>
> > What methods is there to do this? sessions?
>
> Yes, I think sessions would provide a more secure and elegant solution for
> what you are doing. I also think that you'll find things easier from a
> development perspective. You basically would follow this flow (you can
> structure your code however):
>
> 1. When user submits first page of data, validate it, and if it is valid,
> store it in the session. If it is not, goto 10 (funny BASIC reference, for
> those who missed it).
> 2. Go through the same process for the second page (except goto 20 if
> there is invalid data).
> 3. On the third page, display the valid data that is stored in the
> session. When the user clicks the button (or whatever) on this page, no
> data is actually sent, because the server already has it all. You just
> store the data that you already have in the session.
>
> This also saves you from passing data back and forth between the user and
> the server for every page.
>
> Hope that helps.
>
> Chris
>
> =====
> Chris Shiflett - http://shiflett.org/
>
> PHP Security - O'Reilly
> Coming mid-2004
> HTTP Developer's Handbook - Sams
> http://httphandbook.org/
> PHP Community Site
> http://phpcommunity.org/