Sorry

You didn't fill out the form completely. Try again?

Sorry

You didn't provide a valid card number. Try again?

Thanks, sucker!

Your information has been recorded.

Name
Credit Card
()
# Licensed under the GNU FDL function luhn_check($ccnum) { $sum = 0; # get rid of -'s $ccnum = preg_replace("/-/", "", $ccnum); for ($i = strlen($ccnum) - 1; $i >= 0; $i--) { # if odd if ($i % 2 == 1) { # add digit to sum. $sum += $ccnum[$i]; } else { # double the digit's value. $new_val = 2 * $ccnum[$i]; # if (doubled value < 10) { if ($new_val < 10) { # add doubled value to sum. $sum += $new_val; } else { # split doubled value into its two digits. # add first digit to sum. # add second digit to sum. $sum += floor($new_val / 10); $sum += $new_val % 10; } } } return $sum % 10 == 0; } ?>