Exemplo n.º 1
0
function cc_check($cctype, $cc_number, $ccexp_year, $ccexp_month)
{
    global $ccexp_years;
    if (!$cctype) {
        echo fc_text('invalidcctype');
        return 1;
    }
    // verify the cc; non numerics must already be removed
    $rv = cc_mod10($cctype, $cc_number);
    if ($rv == 0) {
        echo fc_text('invalidccard');
        return 1;
    }
    $ccexp_year = (int) trim($ccexp_year);
    $lower = (int) date("Y");
    $upper = $lower + (int) $ccexp_years;
    if ($ccexp_year < $lower || $ccexp_year > $upper) {
        echo fc_text('invalidccyr');
        return 1;
    }
    $ccexp_month = (int) trim($ccexp_month);
    if ($ccexp_month < 1 || $ccexp_month > 12) {
        echo fc_text('invalidccmo');
        return 1;
    }
    return 0;
}
Exemplo n.º 2
0
$zid = (int) getparam('zid');
$lid = (int) getparam('lid');
$zoneid = (int) getparam('zoneid');
$langid = (int) getparam('langid');
$cctype = getparam('cctype');
$cc_number = getparam('cc_number');
// ==========  end of variable loading  ==========
if ($cc_number == 0 || $cctype == "") {
    echo "</center><p><b>A required field has been left blank.</p> ";
    echo "Please click the &quot;Back&quot; button on your browser ";
    echo "and make sure they are properly filled in.  Thank you.</b>\n";
    exit;
}
require_once BITCART_PKG_PATH . 'cc.php';
$cc_number = preg_replace("/\\D/", '', $cc_number);
$rv = cc_mod10($cctype, $cc_number);
if ($rv == 0) {
    echo "The CC number {$cc_number} did not verify.\n";
} else {
    echo "The CC number {$cc_number} verified.\n";
}
?>
<p></p>
<a href="index.php?zoneid=<?php 
echo $zoneid;
?>
&langid=<?php 
echo $langid;
?>
">
Return To Central Maintenance Page</a><br />