Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Jay Blanchard wrote: [snip] JavaScript can't be used for such things, or at least it can't be relied upon. What if the user has disabled JavaScript? Or what if the user has specifically disabled the JavaScript behaviour you are relying on? [/snip] Egg Zachary. That was why I wanted a PHP method. Since the SESSION data is set for the activation receipt I do not have to query the database again, save for the initial query to check and see if the data exists. You're still doing two round-trips to the server, which seems very inefficent to regulate user behavior. -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Preventing double-clicks APPEARS TO WORK FINE
[snip] I am going to do some thinking (typing) out loud here because I need to come up with a solution to double-clicking on a form button issue. [/snip] Because the data is contained in session variables this became an easy issue once I logiced it out /* * we have to find out if a double click occurred but we are going to allow for a much longer time interval * of 30 minutes in order to make sure that the ESN can be provisioned again, just not today. */ $getESNDate = SELECT `ezESN` FROM `test`.`provision` ; $getESNDate .= WHERE `updated` BETWEEN DATE_SUB(NOW(), INTERVAL 1800 SECOND) AND DATE_SUB(NOW(), INTERVAL 1 SECOND) ; $getESNDate .= AND `ezESN` = '.$_POST['psESN'].' ; if(!($dbESNDate = mysql_query($getESNDate, $udc))){ echo mysql_error(); exit(); } /* does it test positive for ESN within the past few minutes? */ if(0 != mysql_num_rows($dbESNDate)){ /* the session data is already set, so go to activation receipt */ header(Location: ezActivationReceipt.php); exit(); } else { /* process normally */ /* lines and lines of code */ } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Jay Blanchard wrote: [snip] I am going to do some thinking (typing) out loud here because I need to come up with a solution to double-clicking on a form button issue. [/snip] Isn't there a javascript method that you could use to accomplish the same thing? Either that, or on the first click, you could disable that button. -- Online library -- http://pueblonative.110mb.com 138 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
On Mon, June 26, 2006 2:05 pm, John Meyer said: Jay Blanchard wrote: [snip] I am going to do some thinking (typing) out loud here because I need to come up with a solution to double-clicking on a form button issue. [/snip] Isn't there a javascript method that you could use to accomplish the same thing? Either that, or on the first click, you could disable that button. That would be the Javascript method to accomplish the same thing. :-) It's probably more efficient than a PHP-based solution, modulo the usual Javascript caveats (user can disable, etc.). --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
John Meyer wrote: Jay Blanchard wrote: [snip] I am going to do some thinking (typing) out loud here because I need to come up with a solution to double-clicking on a form button issue. [/snip] Isn't there a javascript method that you could use to accomplish the same thing? Either that, or on the first click, you could disable that button. JavaScript can't be used for such things, or at least it can't be relied upon. What if the user has disabled JavaScript? Or what if the user has specifically disabled the JavaScript behaviour you are relying on? For example, some websites very wrongly try to disable right-clicking on webpages. Firefox provides an option (I'm not sure if it is enabled by default) that prevents pages from disabling right-click. So using said JavaScript code to disable right-clicks is not a valid way of preventing people from viewing page source or downloading files. The same would apply to any other security measure; it'd be just fine to use JavaScript to discourage multiple clicks, but it wouldn't solve the underlying problem; he'd still have to solve the problem on the backend. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Preventing double-clicks APPEARS TO WORK FINE
[snip] JavaScript can't be used for such things, or at least it can't be relied upon. What if the user has disabled JavaScript? Or what if the user has specifically disabled the JavaScript behaviour you are relying on? [/snip] Egg Zachary. That was why I wanted a PHP method. Since the SESSION data is set for the activation receipt I do not have to query the database again, save for the initial query to check and see if the data exists. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Jay Blanchard wrote: [snip] JavaScript can't be used for such things, or at least it can't be relied upon. What if the user has disabled JavaScript? Or what if the user has specifically disabled the JavaScript behaviour you are relying on? [/snip] Egg Zachary. That was why I wanted a PHP method. Since the SESSION data is set for the activation receipt I do not have to query the database again, save for the initial query to check and see if the data exists. I found that my own problem with double click was caused by simply not updating the session flag early enough! i.e. before trying to do anything with the database connection ;) -- Lester Caine - G8HFL - L.S.Caine Electronic Services - http://home.lsces.co.uk Model Engineers Digital Workshop - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/ Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE
Hi gang: I don't know who originally asked, but if you generate and use a token with a session, you can prevent double posting (clicking). tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php