Re: Re: Using a reentrant form
| From: | Tony Marston | Date: | Wed, 14 Mar 2007 23:21:54 +0000 |
| Subject: | Re: Re: Using a reentrant form | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250618@lists.php.net to get a copy of this message | ||
""Richard Lynch"" <ceo@l-i-e.com> wrote in message
news:46589.216.230.84.67.1173911193.squirrel@www.l-i-e.com...
> And if the user re-loads the page they just POSTed?
Easy peasy. After a successful POST I perform a redirect, either to the same
page or a different, which changes the POST into a GET. So if the user
presses the "refresh" button it simply repeats the GET.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
> On Wed, March 14, 2007 10:24 am, Tony Marston wrote:
>> I honestly don't know why people use the approach of having a hidden
>> field
>> on a re-entrant form to indicate whether it should be validated or
>> not. I
>> have used re-entrant forms for years without such a thing. How? Quite
>> simply
>> there are two phases to a form - GET, which requests a form from the
>> server,
>> and POST, which sends a form to the server. It is therefore quite
>> obvious
>> that I validate on every POST. Simple, isn't it?
>>
>> --
>> Tony Marston
>> http://www.tonymarston.net
>> http://www.radicore.org
>>
>> "Todd Cary" <todd@aristesoftware.com> wrote in message
>> news:D9.28.12809.EE0C6F54@pb1.pair.com...
>>> To validate a page, I set the form value to the page name the user
>>> is on.
>>> Then there is a hidden variable, "looped" that is set to "1". By
>>> checking
>>> "looped", I know if the user has re-entered the form so I can do my
>>> validation checks.
>>>
>>> Is there a disadvantage to this approach?
>>>
>>> Thank you...
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?