One of the most important functions of any eCommerce web site is credit card number storage and validation. In this article David develops a PHP class that stores the details of a credit card and validates its number using the Mod 10 algorithm.
Creating a Credit Card Validation Class With PHP (Page 1 of 6 )
Although online payment options such as PayPal have become extremely popular in the last couple of years, the majority of online stores still use some sort of merchant system to accept credit card payments from their web sites. Before actually encrypting your customer's credit card numbers to a database or forwarding them to a merchant server, it's a good idea to implement your own credit card validation routine.
In this article we're going to work through developing a PHP class that stores the details of a credit card and validates its number using the Mod 10 algorithm. To implement the class that we will create in this article, you should have access to an Apache web server running PHP 4.1.0 or later.