Yep - you could write this the other way to generate a list of valid credit card numbers, so these checks described here can't be the /only/ checks you make. But they're useful routines none the less for form validation. For example I reccomend that my customers check the name / postcode / address against the electoral register (which is availible on CD) and then PDQ the card itself prior to despatching any goods.
Just to speculate... if you were to write it the other way you would be better to list all of the valid numbers starting from the number of a real credit card. Such a piece of code would look like this:
That way you'd be much more likley to hit number that won't be rejected as an invalid card.Code:range =1 for x = 1 to cardlen -1 range = range * 10 next for n = realcardnum to realcardnum + range if LuhnCheck(p_cardno) = true then echo n end if next n
As I say...just speculation.




.
