Login   Register  
PHP Classes
elePHPant
Icontem

File: cctest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  credit card validation  >  cctest.php  >  Download  
File: cctest.php
Role: Example script
Content type: text/plain
Description: example
Class: credit card validation
Validate credit card numbers
Author: By
Last change:
Date: 2005-04-17 21:47
Size: 626 bytes
 

Contents

Class file image Download
<?php
    
include("creditcard.inc.php");

    
$cc=new CCVAL;
    
    
$ccnum="4111111111111111";
    
$cctype="visa";

    
/*Test credit cards

        370000000000002 American Expres (amex)  

        6011000000000012 Discover

        5424000000000015 Master Card

        4111111111111111 visa
    */

    /*if($cc->isVAlidCreditCard($ccnum))
        echo "Valid credit card .";
    else
        echo "Not valid!";

    if($cc->isVAlidCreditCard($ccnum,$type))
        echo "Valid credit card .";
    else
        echo "Not valid!";*/

    
$obj=$cc->isVAlidCreditCard($ccnum,"",true);
    echo 
$obj->valid;
    echo 
"<br>";
    echo 
$obj->ccnum;
    echo 
"<br>";
    echo 
$obj->type;

?>