Código PHP:
<?php
include("phpcreditcard.php");
$cc=new CCVAL;?>
<form name="tarjeta" method="post" action="">
<select name="tipo_tarjeta" id="tipo_tarjeta">
<option value="Visa">Visa</option>
<option value="Master Card">Master Card</option>
</select>
<input name="CardNumber" id="CardNumber" type="text" size="20" />
<input type="button" value="Validar tarjeta" id="validar" name="validar" onclick="alert('Procesando')"/>
</form>
<?php
if(isset($_POST['validar']))
{
$ccnum=$_POST['CardNumber'];
$cctype=$_POST['tipo_tarjeta'];
sleep(10);
$obj=$cc->isVAlidCreditCard($ccnum,"",true);
echo $obj->valid;
if ($obj->valid == 1){
echo "<script>alert('La tarjeta número: $ccnum ES VALIDA');</script>";}
else {
echo "<script>alert('La tarjeta número: $ccnum de $cctype NO ES VALIDA reintente de nuevo');</script>";}
}
?>