• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Validating Forms > Validating Credit Card Numbers

Validating Credit Card Numbers

Somewhat surprisingly, the method of checking if a credit card number is valid is public. Using a complicated method of cruising through the card's digits, you can create what's called a Luhn checksum. Once you've created this checksum, you can see whether it has a valid value. If the value isn't valid, then the card is definitely fake. If the Luhn checksum is correct, then the card might be valid. Since this method is public, it is possible to create your very own phony credit card numbers. However, this is super duper illegal, so for Pete's sake, don't do it. And besides, these phony numbers won't have valid names or expiration dates, so even if you decided on a life of crime, you'd need to do a lot of extra work that this book won't help you with.

For the more law-abiding, let's look at the new fields we're adding to our Shelley page. They look like Figure 7-2.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint