Page 1 of 1

CC# Form Field Validation

Posted: Mon Aug 18, 2003 4:00 pm
by Markian
I'm looking to validate there are 16 (or whatever) digits entered by the client into a form field (credit card). I'm not looking to verify the customer's account (there's PayPal for that). If it's not too fancy, maybe check to see if the beginning digit is correct for the appropriate credit card too. Any help is much appreciated.

Posted: Mon Aug 18, 2003 4:05 pm
by jason
You want to use the luhn algo.

You can see more information here:

http://www.zend.com/codex.php?id=31&single=1

Posted: Tue Aug 19, 2003 10:50 am
by m3rajk
is luhn the one that validates the first part and can tell you which type of card (and in some cases which bank issued it) tha the person is using?

Posted: Tue Aug 19, 2003 2:01 pm
by Markian
Thanks for the info!