[FX.php List] Problem with double submissions

Dale Bengston dbengston at tds.net
Tue Sep 28 17:10:26 MDT 2010


This is bringing back some memories of CURL problems...?
Dale

On Sep 28, 2010, at 2:04 PM, Bob Patin wrote:

> Only problem is that it goes to Authorize.net first, which is where their credit card gets charged.
> 
> So I need to prevent them from getting charged twice.
> 
> I think the issue right now is their web server, so I'm having them reinstall WPE for the 3rd or 4th time. I'll just say that I NEVER have this sort of problem on my Mac servers...
> 
> 
> On Sep 28, 2010, at 12:19 PM, Gjermund Gusland Thorsen wrote:
> 
>> Heh, I would use a string for every form <<CCYYMMDDHHIISS>> made at
>> the same time as the form,
>> then I would store that value in a unique field in FileMaker, then
>> when ['errorCode'] == 504 shows up...
>> 
>> tada! You could trap the error in php.
>> 
>> Then they can submit as many times as they want, and you only keep the
>> first one, or you can also choose to store updates if need be.
>> 
>> -Joel
>> 
>> 
>> 
>> ooops, I mean ggt
>> :-p
>> 
>> 2010/9/27 Joel Shapiro <jsfmp at earthlink.net>:
>>> http://ajaxload.info/
>>> 
>>> ggt
>>> 
>>> 
>>> 
>>> oops, I mean -Joel
>>> ;-)
>>> 
>>> 
>>> 
>>> On Sep 27, 2010, at 9:08 AM, Dale Bengston wrote:
>>> 
>>>> This is my method as well. But instead of just disabling the button, I
>>>> replace it with a progress indicator so that the user knows something is
>>>> transpiring.
>>>> 
>>>> I'm using Scriptaculous, but the principles are the same. It could be done
>>>> with a plain-old JavaScript function as well.
>>>> 
>>>> Dale
>>>> 
>>>> On Sep 27, 2010, at 10:31 AM, Andy Gaunt wrote:
>>>> 
>>>>> Hey Bob,
>>>>> 
>>>>> Why not disable the button instead?
>>>>> 
>>>>> You can do this with jQuery if you are using it or just adding an onClick
>>>>> to the element
>>>>> 
>>>>> onclick="this.disabled=true;"
>>>>> 
>>>>> jQuery might look like:
>>>>> 
>>>>> 
>>>>> $('#yourform').submit(function(){
>>>>>   $('input[type=submit]', this).attr('disabled', 'disabled');
>>>>> });
>>>>> 
>>>>> 
>>>>> You could also change the value of the submit button to "Processing..."
>>>>> or something similar as well to give the end user some feedback that the
>>>>> page is working
>>>>> 
>>>>> 
>>>>> HTH
>>>>> 
>>>>> 
>>>>> Andy Gaunt
>>>>> T: 321-206-3658
>>>>> andy at fmpug.com
>>>>> 
>>>>> http://www.fmpug.com
>>>>> FMPug.com: A Developer's best Friend!
>>>>> Follow us today at http://twitter.com/fmpug
>>>>> 
>>>>> FindFileMakerDevelopers.com - The #1 listings engine for FileMaker
>>>>> Professionals
>>>>> Follow us today at http://twitter.com/findfmdevs
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Sep 27, 2010, at 11:09 AM, Bob Patin wrote:
>>>>> 
>>>>>> I've got a problem with a client's web server that sometimes slows down
>>>>>> so much that customers are double-submitting their orders, causing their
>>>>>> card to get hit twice.
>>>>>> 
>>>>>> Here's what *should* happen on a well-behaved web server:
>>>>>> 
>>>>>> Page submits, Authorize.net runs the charge, order gets updated in
>>>>>> FileMaker with the transactionID.
>>>>>> Customer goes to the confirmation page, where they see a printable
>>>>>> invoice
>>>>>> Session variable gets destroyed
>>>>>> 
>>>>>> BUT HERE'S WHAT HAPPENS:
>>>>>> The web server, for which I have no control and no faith, seems to time
>>>>>> out sometimes on this page, where auth.net processes the card.
>>>>>> 
>>>>>> I've been trying to write a Javascript function to prevent double
>>>>>> submissions; here's what I'm trying:
>>>>>> 
>>>>>> On my button, which is an image, I have this:
>>>>>> 
>>>>>> <input type="image" name="mySubmit" src="images/process_cc.jpg"
>>>>>> alt="ticket_cc_process.php" width="180" height="32" onclick="javascript:
>>>>>> return check_submit();">
>>>>>> 
>>>>>> Then, here's my JS function:
>>>>>> 
>>>>>> <script language="Javascript">
>>>>>> function check_submit (){
>>>>>>       if (document.form1.form_submitted.value == 1){
>>>>>>               alert("Don't submit twice. Please wait.");
>>>>>>               return false;
>>>>>>       }else{
>>>>>>               document.form1.form_submitted.value = 1;
>>>>>>               return true;
>>>>>>       }
>>>>>> }
>>>>>> 
>>>>>> </script>
>>>>>> 
>>>>>> So my problem is that I can't get the form to time out, giving me enough
>>>>>> time to see whether this actually works--customers seem to be able to, but
>>>>>> not me.
>>>>>> 
>>>>>> QUESTION:
>>>>>> Is there a better way to do this, better code, better method?
>>>>>> 
>>>>>> Thanks,
>>>>>> 
>>>>>> 
>>>>>> Bob Patin
>>>>>> Longterm Solutions
>>>>>> bob at longtermsolutions.com
>>>>>> 615-333-6858
>>>>>> http://www.longtermsolutions.com
>>>>>> iChat: bobpatin
>>>>>> FileMaker 9, 10 & 11 Certified Developer
>>>>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>>>>> --
>>>>>> Expert FileMaker Consulting
>>>>>> FileMaker Hosting for all versions of FileMaker
>>>>>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>>>>>> 
>>>>>> _______________________________________________
>>>>>> 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
>>> 
>>> _______________________________________________
>>> 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