[thelist] Form validation and resources for known values

Andy Warwick mailing.lists at creed.co.uk
Sat Feb 1 05:48:01 CST 2003


Hi

I'm in the process of writing a PHP form class that includes various
validation routines, both server and -- eventually -- client side. It
would be useful, therefore, to know some specifications for some of the
special field types, so I can check what for valid values.

Can anyone point me at a resource that lists one or more of the
following:

The maximum range in the future that Credit Card expiry dates are valid
(e.g. 3 years, 5 years, etc.). I'm betting that most cards are issued
with 5 years or less, but I don't want to exclude anyone with a really
exclusive card that is valid for longer.

I've found the stuff about CC numbers being 16, 15 digits etc, and the
routines to check them, but could do with the definitive resource on
all types of card available and valid ranges, etc.

	http://www.webreference.com/programming/carts/chap7/3/

So far I've got: VISA, Mastercard , AMEX , Dinsersclub , Carteblanche ,
Discover , Enroute , JCB.

Can anyone with a AMEX, Diners Club or 13 digit VISA also confirm how
the numbers are arranged...

I'm assuming all 16 digit cards are of the format XXXX-XXXX-XXXX-XXXX;
anyone know different?

I'm also after:

Worldwide telephone number formats (maximum digits for area code, etc.)

Passport number validation and expiry date info, ideally for various
countries.

Anything else that could possibly be validated against known values.

I'm quite prepared to hunt for this stuff, and have got a few (like
spec. for UK postcodes), but I'm betting at least someone here
(Martin?) already has this stuff to hand and can point me to the right
place.

Once it's done, I'll open source the class and stick it on my site, so
anyone can use it. (If anyone wants to take a look now, or even help,
email me offlist and I'll send a copy...)

TIA

--
Andy Warwick

Creed New Media Design, Nottingham, UK
[t] +44 (0)115 8476867
[w] <http://www.creed.co.uk/src/evolt/index.htm>




More information about the thelist mailing list