[thelist] php javascrip CC validation

martin.p.burns at uk.pwcglobal.com martin.p.burns at uk.pwcglobal.com
Fri Apr 12 08:38:01 CDT 2002


Memo from Martin P Burns of PricewaterhouseCoopers

-------------------- Start of message text --------------------

Sasha

The Luhn algorithm for cc validation has been about for a number of decades
and is reasonably well known.

Of course, it should only ever be a first pass check - you'll need to do
some real CC validation (ie making sure that it's an active account, not
been stolen and that there are funds available) as well, but the Luhn
algorithm will catch simple typos, thus lightening the load on your
authentication service.

I'd also incorporate a Luhn check in your PHP application to allow for
users without JS.

Here's a JS Luhn algorithm:
http://javascript.about.com/library/scripts/blccvalid.htm

and here's a PHP one:
http://www.zend.com/codex.php?id=31&single=1
plus some more useful stuff at
http://px.sklar.com/section.html?section_id=3

Cheers
Martin



Would this even be a wise thing to do?  Any shmuck who
reads the source could make up their own "valid" credit
card number.

Christy "sasha" Siepker
http://bittersweet2.com

4/12/2002 3:56:09 AM, "Andrew Maynes" <andrew at uk-
webdeveloper.co.uk> wrote:

>I have a php cart...does anyone have a js cc validator
I can incorporate in to
>the form?



--------------------- End of message text --------------------

This e-mail is sent by the above named in their
individual, non-business capacity and is not on
behalf of PricewaterhouseCoopers.

PricewaterhouseCoopers may monitor outgoing and incoming
e-mails and other telecommunications on its e-mail and
telecommunications systems.
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.




More information about the thelist mailing list