<?
function prestoLUHN($ccn="",$alt="0")
{
// pre-validations
$ccn = ereg_replace("[^[:digit:]]+", "", $ccn);
if ((strlen($ccn) < 1)) return FALSE;
// Mapping: Double-then-SumOfDigits (0123456789) => (0246813579)
for($i=0;$i<=9;$i++) $v[$i] = (($i*2)<9) ? ($i*2):($i*2)-9;
// Initial value of $alt (Alternation Pattern) determines which digits are transformed by $v[] during checksum calculation
// 0 = apply transform to even-numbered digits from LSD-to-MSD (Conventional LUHNMod10)
// 1 = apply transform to odd-numbered digits from LSD-to-MSD (alternative)
$checksum = 0;
// Calculate checksum from the end of the string (the low-order digit) to beginning of string
for($i = strlen($ccn)-1; $i >= 0; $i--)
{
$digit = substr($ccn, $i, 1);
$checksum += $alt ? $v[$digit] : $digit;
$alt ^= 1;
}
// return the checksum descrimination result
return !($checksum % 10);
// Mon 03 Jan 2000, Doug Preston (presto@readynet.net)
};
?>
credit card security code Categories : PHP , Credit Cards , PHP Classes , Credit Cards A set of functions to check the validity of a credit card number. Categories : Ecommerce , Credit Cards , PHP Credit Card validation routine. Uses MOD 10 to check if credit card number is valid. Categories : Ecommerce , Credit Cards , PHP , Complete Programs an example of the cyberlib payment class Categories : PHP , PHP Classes , Ecommerce , Credit Cards Credit Card Identification and Validation Class - The credit_card class provides methods for cleaning, validating and identifying the type of credit card numbers. Categories : PHP , PHP Classes , Credit Cards , Ecommerce , Algorithms After discovering some credit card validation routines didnt work - here is one that I found works with all the numbers I have tried so far Categories : Credit Cards , Ecommerce , PHP gpg encryption. 99% of it will apply to PGP.
Categories : Credit Cards , Authentication , Ecommerce , Misc ECHOcart - Open Source Shopping Cart Categories : PHP , Credit Cards , Ecommerce Sample AIM (Advanced Integration Method) PHP Script For Authorize.net using CURL Categories : CURL , Ecommerce , PHP Amazon.com API, CURL-REST Parser. Obtain data about Amazon products (PHP5 +) Categories : PHP , Ecommerce , XML , Web Services , CURL Using Postgres and PHP3 Authentication from a Web application Categories : PostgreSQL , HTML and PHP , Authentication , PHP Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP , PHP , HTML , PDF , Excel MD5 secured login Categories : PHP , Java Script , Authentication , Security Authorize Me! An authentication script. Categories : MySQL , Databases , Authentication , PHP A simple PHP login script that you can modify to suite your needs. It use a session to store data in a session file submited by the page. Categories : PHP , Sessions , Security , Authentication