Location: PHPKode > scripts > CreditCard Class > creditcard-class/creditcard.php
<?
/*
 * Example file
 * GPL
 * $Id: creditcard.php,v 1.1 2002/02/16 16:02:12 daniel Exp $
 */
require("creditcard_class.php");
$cc = new creditcard;
?>

<html>
<head>
  <title>CreditCard Class Script</title>
</head>
<body bgcolor=#ffffff>

<?
if($card)
{
  printf("The %s is a %s card<br>\n", $card,
    (($ccret = $cc->check($card))?"valid":"false"));

  if($ccret)
  {
    printf("The card type is %s or %d<br>\n", $cc->detectTypeString(),
      $cc->detectType());
    printf("Card number: %s<br>\n", $cc->getCardNumber());
  }
  else
    printf("%s<br>\n", $cc->strError());

}

?>

<form action="creditcard.php" method=get>
Card: <input type=text name=card size=20><p>
<input type=submit value="Submit">
</form>

</body>

Return current item: CreditCard Class