php-general Digest 22 Nov 2009 19:01:54 -0000 Issue 6455
Topics (messages 300024 through 300032):
Re: Recognizing double clicks
300024 by: Skip Evans
300025 by: Manuel Lemos
300026 by: Hans Ã
hlin
300030 by: Phpster
300031 by: tedd
300032 by: Mark Kelly
My experience with the "Forms Generation and Validation" class
300027 by: LinuxManMikeC
Re: Which query is more correct?
300028 by: LinuxManMikeC
Re: Creating users and generating privileges for users
300029 by: LinuxManMikeC
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
It just dawned on me the button may be disabled right when
it's clicked to prevent a double submit?
Is that doable?
Skip
Skip Evans wrote:
Hey all,
Every site I've ever stuck a credit card into said "only click
once...". I just this requirement from a client.
a.System should recognize a duplicated click, so the message in red
“only click once” should be unnecessary.
Is this doable???
Has anyone on the list ever done this???
--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
Hello,
on 11/22/2009 03:34 AM Skip Evans said the following:
> It just dawned on me the button may be disabled right when it's clicked
> to prevent a double submit?
>
> Is that doable?
This forms generation class can do exactly that. It generates Javascript
with form HTML that disables the form submit button while the form is
submitted. Then it enables the submit button again. If the user clicks
on the button again, an alert message appears asking whether the user
really wants to submit the form again.
http://www.phpclasses.org/formsgeneration
Here you can see a live example:
http://www.meta-language.net/forms-examples.html?example=test_form
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Write a function that generate a unique form id and one that checks if
it already has been submitted.
Store data that the script sends after a submit has been done in the
session array and if it is a re-submit just re-send the the data.
2009/11/22 Skip Evans <s...@bigskypenguin.com>:
> Hey all,
>
> Every site I've ever stuck a credit card into said "only click once...". I
> just this requirement from a client.
>
> a.System should recognize a duplicated click, so the message in red “only
> click once” should be unnecessary.
>
> Is this doable???
>
> Has anyone on the list ever done this???
> --
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
> -- Kurt Vonnegut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
MvH / Hans Åhlin
Tel: +46761488019
http//www.kronan-net.com/
--- End Message ---
--- Begin Message ---
Yep
Bastien
Sent from my iPod
On Nov 22, 2009, at 12:34 AM, Skip Evans <s...@bigskypenguin.com> wrote:
It just dawned on me the button may be disabled right when it's
clicked to prevent a double submit?
Is that doable?
Skip
Skip Evans wrote:
Hey all,
Every site I've ever stuck a credit card into said "only click
once...". I just this requirement from a client.
a.System should recognize a duplicated click, so the message in re
d “only click once” should be unnecessary.
Is this doable???
Has anyone on the list ever done this???
--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
At 11:30 PM -0600 11/21/09, Skip Evans wrote:
Hey all,
Every site I've ever stuck a credit card into said "only click
once...". I just this requirement from a client.
a.System should recognize a duplicated click, so the message in red
"only click once" should be unnecessary.
Is this doable???
Has anyone on the list ever done this???
Yes. I have done this before.
Three things:
1. The Credit Card processing company should have "Duplicate
Suppression" turned ON. Contact them.
2. Use javascript to deactivate the Submit button after it's clicked.
3. Just in case the user has javascript disabled, then have your php
form generate a token and place that value in a session. That way,
upon a refresh (double click) you can check if the session contains
anything and if it does, then don't do anything.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Hi.
On Sunday 22 Nov 2009 at 05:34 Skip Evans wrote:
> It just dawned on me the button may be disabled right when
> it's clicked to prevent a double submit?
>
> Is that doable?
To mark a button as disabled after it has been clicked to prevent it being
clicked twice just add some simple code in the button (all on one line in case
it wraps):
onClick="this.disabled=true; this.value='Processing'; this.form.submit();"
However I would also do something server side (a unique ID for every form
served works well) to handle browsers that don't have javascript turned on.
Never rely on (or trust) code running on the client.
Cheers,
Mark
--- End Message ---
--- Begin Message ---
Just like to share my real world experience with Manuel Lemos'
"formsgeneration" library.
http://www.phpclasses.org/formsgeneration
At work early this summer we had a project under a tight deadline that
needed unified form creation, processing, and error reporting. I had
seen Manuel promoting his formsgeneration class on the mailing list
and thought I'd look into it to help keep the project within the
deadline. I read some positive reviews and comments, the demos looked
promising, and the interface seemed good enough. Little did I know
the headaches I was in for. I found the configuration structures and
interface to be extremely cumbersome, not to mention terribly
documented. The interface seems quite inefficient and in most cases
its easier just to throw together a form and validation code by hand.
Usage was often convoluted, and due to the poor documentation I spent
half my effort trying to decipher the interface. And it was difficult
to customize in several areas. While it can work well enough in
several simple cases, in my opinion it is too cumbersome for any
significant form processing project, especially in the business world.
I ended up wasting a week of work using the formsgeneration class and
had to redo the project making my own form utility code from scratch
as I went (which took just as much time and actually worked as
intended). Granted I did make the mistake of not giving myself enough
evaluation time before the project. I just want caution others to
carefully evaluate this code before deciding to use it in their
projects, especially since Manuel seems so eager to promote his code
(and his web site) whenever the opportunity arises. And in general,
to be cautious and take your time when evaluating any 3rd party code
for production use.
--- End Message ---
--- Begin Message ---
On Sat, Nov 21, 2009 at 2:52 PM, Nathan Rixham <nrix...@gmail.com> wrote:
> Rick Pasotto wrote:
>> On Fri, Nov 20, 2009 at 04:41:58PM -0600, LAMP wrote:
>>> Hi,
>>> I need to pull all records from the table Registrants they are NOT
>>> in the table ToBeRecleared
>>>
>>> Registrants.Reg_ID is PK
>>> ToBeRecleared.tbrc_Reg_ID is PK
>>>
>>> Which query is more correct?
>>>
>>> SELECT r.*
>>> FROM registrants r
>>> where r.reg_status=1 AND r.reg_id NOT IN (SELECT tbrc_reg_id FROM
>>> toberecleared)
>>>
>>>
>>> SELECT r.*
>>> FROM registrants r
>>> where r.reg_status=1 AND (SELECT count(*) FROM toberecleared where
>>> tbrc_reg_id=r.reg_id) = 0
>>>
>>> I checked explain of bot queries - but can't "read" them. :-)
>>
>> SELECT t1.*
>> FROM registrants t1
>> LEFT JOIN ToBeRecleared t2 on t1.reg_id = t2.tbrc_reg_id
>> where t2.tbrc_reg_id is NULL
>>
>
> ^^^ what rick said; the left join with where null is the "correct" one
>
In my book the "correct" one is anything that gives you the "correct"
answer. After that the question is "which is the better one?" That
said, Rick's does look pretty cool.
--- End Message ---
--- Begin Message ---
On Sat, Nov 21, 2009 at 7:05 AM, tedd <tedd.sperl...@gmail.com> wrote:
> At 6:36 PM -0600 11/20/09, nitin reddy wrote:
>>
>> Hey can one help me in creating different users using mysql for php and
>> assigning different privileges for them ..any sample code available?
>> --
>> PASULA NITIN REDDY
>> Graduate Student in Computer Science Department
>> University of Minnesota,Twin Cities
>> Minneapolis.
>
> PASULA:
>
> And where do you want us to send your homework?
>
> Seriously, if you want help, please show us what you've done -- from there
> we can move on.
>
> Cheers,
>
> tedd
A CS graduate student, eh? Now I'm curious as to what he's actually done too.
BTW, nice signature Pasula. How's the weather in Minnesota? We await
your reply with bated breath.
--- End Message ---