Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorashmi
    • CommentTimeDec 7th 2006
     
    Hi
    I run an oscommerce site, and because of slow connections to the server, Im often getting duplicate orders.
    I have already programmed the checkout confirmation script with javascript, where it a) disables the button, and /cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> changes the button to processing please wait...
    however I am still getting duplicates coming through, so I can only guess that these extra orders are from customers with javascript disabled, and repeatidly press the button
    Is there any way of programming the button to be pressed only once in PHP
    thanks
  1.  
    As far as I'm aware, no. But, could you not assign the order number in the page (i.e sending order number with form) so if they submit the same page twice, it gives error that the order as already been sent.
    • CommentAuthorsurfer
    • CommentTimeDec 7th 2006
     
    try sessions, so every cusotomer would have is own session and as mas_willsy said you would put there order number or something and the processing script would give error when the order number would be duplicate
    • CommentAuthorjustnajm
    • CommentTimeDec 14th 2006
     
    Hi,

    Try to use the php validation script for similar values coming through post variables if all the variables are similar then don't insert the record else insert the record, this will avoid every chance of double clicking or doing refresh etc. on the same page.

    1. connect to database order table.

    2. retrieve the similar record in the array by comparing $_POST variables(comming values from user) with table column values. If the query retrieve any one record means that the record is already present. Don't run insert query.

    If query returns no record then run the insert query.

    This is how I prevent my users from refreshing the page, due to which all the variables are resend on the page and this duplicate problem occur. Keep the script on the page which will handle the variables.