Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,171 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,920 people online right now. Registration is fast and FREE... Join Now!




Zip Code / Postal Code Validation

 
Reply to this topicStart new topic

Zip Code / Postal Code Validation

1learner
24 Dec, 2007 - 07:33 PM
Post #1

New D.I.C Head
*

Joined: 24 Dec, 2007
Posts: 4

Is there any standardised utility or API specifications for validation of postal or zip codes?

User is offlineProfile CardPM
+Quote Post

lockdown
RE: Zip Code / Postal Code Validation
24 Dec, 2007 - 07:42 PM
Post #2

D.I.C Regular
Group Icon

Joined: 29 Sep, 2007
Posts: 376



Thanked: 1 times
Expert In: PC, Support

My Contributions
Are you looking for a database of zip codes to verify user input with?
User is offlineProfile CardPM
+Quote Post

1learner
RE: Zip Code / Postal Code Validation
24 Dec, 2007 - 09:00 PM
Post #3

New D.I.C Head
*

Joined: 24 Dec, 2007
Posts: 4

QUOTE(lockdown @ 24 Dec, 2007 - 08:42 PM) *

Are you looking for a database of zip codes to verify user input with?


The application will accept addresses, so I guess ideally it should able to verify the address entered (e.g. Country and City) against the postal code.

User is offlineProfile CardPM
+Quote Post

lockdown
RE: Zip Code / Postal Code Validation
24 Dec, 2007 - 09:06 PM
Post #4

D.I.C Regular
Group Icon

Joined: 29 Sep, 2007
Posts: 376



Thanked: 1 times
Expert In: PC, Support

My Contributions
Well it all depends on what language u are going with. What do u want to programmer it in?
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Zip Code / Postal Code Validation
27 Dec, 2007 - 08:01 AM
Post #5

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
For the type of validation you are looking for, the methodology would be the same regardless of language. there are a few choices:

1. A database of valid codes with their corresponding address ranges (this can get out of date quickly.
2. An API that can be used to call a source that is maintained at a higher level (not sure what exists for the region you wish to validate against, or even what regions those may be).
3. A software implementation of the business logic around valid codes - the business logic is available from your postal service - you just have to write the code that checks against it.

What regions are you looking to validate against?
User is offlineProfile CardPM
+Quote Post

1learner
RE: Zip Code / Postal Code Validation
28 Dec, 2007 - 07:38 AM
Post #6

New D.I.C Head
*

Joined: 24 Dec, 2007
Posts: 4

QUOTE(Amadeus @ 27 Dec, 2007 - 09:01 AM) *

For the type of validation you are looking for, the methodology would be the same regardless of language. there are a few choices:

1. A database of valid codes with their corresponding address ranges (this can get out of date quickly.
2. An API that can be used to call a source that is maintained at a higher level (not sure what exists for the region you wish to validate against, or even what regions those may be).
3. A software implementation of the business logic around valid codes - the business logic is available from your postal service - you just have to write the code that checks against it.

What regions are you looking to validate against?

Thanks. That sounds about right. We are looking for validating American and European / Middle Eastern addresses mainly. Are there any databases or services around that we could subscribe to?

User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Zip Code / Postal Code Validation
28 Dec, 2007 - 08:55 AM
Post #7

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
There are quite a number, actually. A common one for US/Canada codes is the following:

http://www.zip-codes.com/

but there are many other services. In the end, the service you choose should be chosen based on how you will be validating...and remember, if you choose a standalone database representation, make sure they offer regular updates. smile.gif Or update them yourself, of course.

Finally, depending on what language you are using to program in, some languages offer a postal code class that can at least validate the format, if not the code itself.

User is offlineProfile CardPM
+Quote Post

1learner
RE: Zip Code / Postal Code Validation
29 Dec, 2007 - 08:07 PM
Post #8

New D.I.C Head
*

Joined: 24 Dec, 2007
Posts: 4

QUOTE(Amadeus @ 28 Dec, 2007 - 09:55 AM) *

There are quite a number, actually. A common one for US/Canada codes is the following:

http://www.zip-codes.com/

but there are many other services. In the end, the service you choose should be chosen based on how you will be validating...and remember, if you choose a standalone database representation, make sure they offer regular updates. smile.gif Or update them yourself, of course.

Finally, depending on what language you are using to program in, some languages offer a postal code class that can at least validate the format, if not the code itself.


Thank you. That's useful.
User is offlineProfile CardPM
+Quote Post

snoj
RE: Zip Code / Postal Code Validation
29 Dec, 2007 - 08:17 PM
Post #9

$Null
Group Icon

Joined: 31 Mar, 2003
Posts: 3,304



Thanked: 6 times
Dream Kudos: 700
My Contributions
Another member had a similar problem not that long ago. What he did might interest you.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:34AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month