[FX.php List] preventing refresh from rePOSTing?

Joel Shapiro jsfmp at earthlink.net
Thu Jun 5 09:09:40 MDT 2008


Thanks everybody

@Bob: The header() call goes back to the same page, so this is still  
a one-page solution.  This way there's no need to do any query for  
uniqueness at all, and a browser refresh only refreshes the just- 
loaded page (via the header() call), not the original/submitted page.

@Dale: I like using AJAX, but this client has some users on very old  
computers, so I'm trying to keep JavaScript out of it.

@ggt: I think you mean that the field in FMP could have validation  
set to Unique.  The form is actually for email subscriptions, and the  
client had been manually checking for dupes before sending out their  
newsletters.  I've added the Unique validation to the email field and  
now check for error 504, so this is a nice (& easy) addition.

@William: I haven't gotten into MVC yet.  I had hoped to see examples  
of people using it at last year's DevCon.  This year I'm looking  
forward to Doug Finn's session, which is supposed to address it:  
<http://events.advisor.com/CFF0807p.nsf/wSessionsID/int803>


Best,
-Joel


On Jun 4, 2008, at 3:30 PM, Joel Shapiro wrote:

> What I did was put:
>  header('Location: mypage.php');
>  exit;
>
> after a successful FMNew(), so now a refresh no longer contains  
> POST data
>
> Solved (& pretty painlessly :)
>
> -Joel
>
>
> On Jun 4, 2008, at 3:08 PM, Bob Patin wrote:
>
>> I don't know of a standard way, but you might write some code that  
>> does a duplicate check before writing the record; send some sort  
>> of unique identifier with your POST, and then a dupe record  
>> couldn't be created...
>>
>> Off the top of my rather bald head,
>>
>> Bob Patin
>> Longterm Solutions
>> bob at longtermsolutions.com
>> 615-333-6858
>> http://www.longtermsolutions.com
>> FileMaker 9 Certified Developer
>> Member of FileMaker Business Alliance and FileMaker TechNet
>>
>>   CONTACT US VIA INSTANT MESSAGING:
>>      AIM or iChat: longterm1954
>>      Yahoo: longterm_solutions
>>      MSN: tech at longtermsolutions.com
>>      ICQ: 159333060
>>
>> --------------------------
>> Contact us for FileMaker hosting and programming for all versions  
>> of FileMaker
>> PHP • CDML • Full email services • Free DNS hosting • Colocation •  
>> Consulting
>>
>>
>>
>>
>> On Jun 4, 2008, at 4:51 PM, Joel Shapiro wrote:
>>
>>> Hi all
>>>
>>> I've got a real small project in which a user fills out a web  
>>> form, and as long as all required fields contain data, a new  
>>> record gets created on submit.
>>>
>>> I've got the processing and the form on the same php page.
>>>
>>> Can anyone suggest a quick/easy way to prevent the user from  
>>> rePOSTing -- and thus adding an additional (duplicate) record --  
>>> by refreshing the page after submission?  The page *does* need to  
>>> allow a user to submit additional records after the first  
>>> submission, but I don't want a simple refresh to create a new  
>>> record.
>>>
>>> I can think of some ways to do this but don't want to re-invent  
>>> the wheel if there's some standard way to do this already.
>>>
>>> TIA,
>>> -Joel
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list