More Virtual Promote ... Search Engine Forums · Gazette · Free Website Templates · Scumware.com
.
Virtual Promote Webmasters Toolkit Featured Tools Form Validation Top PPC Bids/Suggestions  
.

 

Web Hosting

Validators


Generators


Encryption


Scripts/Apps


HTML Stuff


SEO/Search Engine Tools


Programmers' Tools


Oddball/Misc Tools



Get The Gazette

The most eagerly anticipated eZine on The Internet.

Each issue is packed with Search Engine News, Expert Programming and Optimization Tips, The Scumbag of the Week, Random Musings from your humble host ... And much more!

Read It -- Get It
spacer

 

 




PHP Credit Card Number Validator Library

Card Number:

This library can be "included" into any PHP application to check the validity of an entered credit card number.

Used properly, it will tell you type of card entered, and if the number entered is a valid one for that card type

Setup and Usage

  • Download the Library and save it as "cccheck.inc.php"
  • In your PHP application, "include" it, like this:
    <?php include_once("/path/to/cccheck.inc.php"; ?>
  • Then, anywhere in your program, you can make calls to the library, as follows:
    Call the "validateCC" function with a credit card number. Returns card type and a 1 on valid card numbers, null on invalid ones.

    $ccnumber = $_POST['credit_card_number'];
    list($type, $valid) = validateCC($number);
    if ( $valid ) {
        // Do something fun with the card
      echo "Number: <b>$ccnumber</b> ... Type: <b>$type</b> ... Valid: <b>$valid</b>";
    }
    else {
      // Return some sort of error
    }
Give it a try here (Don't enter in a real credit card number, though!)

Happy Coding

 

 

Sponsored Links

Search for a Free Domain
The Virtual Promote Toolkit is hosted by the experts at SimpleNet. You should be, too! Whether building a new site or transferring one, there is no other hosting platform comparable to SimpleNet’s; hosting for less than $5/month.
Search for the following tlds: .com, .net, .org, .info, .biz, & .us
Already have a domain or site? Move it to SimpleNet


Hyperseek Search Engine
Member Spotlight
The Truth About Google Revealed
Explosive new software will help you get top 10 rankings in Google & Yahoo. (sumantra)
spacer

 

 

     

© 1995 - 2006  ·  iWeb, Inc DBA JimWorld Productions