How to Validate Address?

V

vunet.us

On the website form, if user enters invalid address, is there a tool
to check city, zip, etc. for USA? I want to avoid users entering some
blah-blah info when registering with my service.
Many thanks for ideas.
 
B

Beauregard T. Shagnasty

On the website form, if user enters invalid address, is there a tool
to check city, zip, etc. for USA? I want to avoid users entering some
blah-blah info when registering with my service.

You would need a back-end database containing all the ~43,000 US
zipcodes and their associated cities. You would also need the
server-side processing to manage it.

Note that some adjacent, small cities (towns/villages) share a zipcode,
so you would have to code appropriately.

You can purchase zipcode databases (tables) at various web sites for as
little as $150US per year. There are normally quarterly updates.

A visitor, once realizing you are checking zipcodes, may still enter a
bogus name and street address.


Anony Moose
123 Blahblah Street
Zap, ND 58580
 
J

Jukka K. Korpela

Scripsit Beauregard T. Shagnasty:
A visitor, once realizing you are checking zipcodes, may still enter a
bogus name and street address.

Or he may move to a better site.

There are sites that require registration for no understandable purpose,
just collecting personal information from users, without ever using the
information for any legitimate end. Such collection of personal data is
illegal within the European Union, though apparently not in the US. But
users indeed have the option of entering bogus data that just meets the
syntactic requirements. If you ever intend to _use_ the data, it will be
more seriously bogus than without the syntactic checks! (That's because a
larger part of it _looks_ OK.)

We cannot know whether that's the case in the OP's problem, but I'd suggest
considering seriously what data you really _need_ - and check it well
server-side. On the other hand, if it's e.g. an e-commerce site where people
can buy things - so that you really need some addresses - then it's mainly
in the users' interest to type in their addresses correctly. You can just
remind them of this.

Any checks have the risk of rejecting correct data. It's actually _very_
difficult to check even an e-mail address reliably. Zip codes might be
easier since they constitute a finite and known set, but what happens when
the set changes, e.g. new codes are added?
 
V

vunet.us

Scripsit Beauregard T. Shagnasty:


Or he may move to a better site.

There are sites that require registration for no understandable purpose,
just collecting personal information from users, without ever using the
information for any legitimate end. Such collection of personal data is
illegal within the European Union, though apparently not in the US. But
users indeed have the option of entering bogus data that just meets the
syntactic requirements. If you ever intend to _use_ the data, it will be
more seriously bogus than without the syntactic checks! (That's because a
larger part of it _looks_ OK.)

We cannot know whether that's the case in the OP's problem, but I'd suggest
considering seriously what data you really _need_ - and check it well
server-side. On the other hand, if it's e.g. an e-commerce site where people
can buy things - so that you really need some addresses - then it's mainly
in the users' interest to type in their addresses correctly. You can just
remind them of this.

Any checks have the risk of rejecting correct data. It's actually _very_
difficult to check even an e-mail address reliably. Zip codes might be
easier since they constitute a finite and known set, but what happens when
the set changes, e.g. new codes are added?

What if I use google map to determine a valid address? I'd get HTML of
the map page with user-supplied 'loc' string and if google does not
find it (will contain string "No match found" inside) I will alert the
user of a wrong address entered...?
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
What if I use google map to determine a valid address?

What if you read comprehensively the answer given to you, instead of quoting
it comprehensively but not uttering anything that suggests that you
understood a word of it?
 
B

Beauregard T. Shagnasty

What happens is that the next quarterly subscription update to the
zipcode database should reflect the new codes. ;-)
What if I use google map to determine a valid address? I'd get HTML of
the map page with user-supplied 'loc' string and if google does not
find it (will contain string "No match found" inside) I will alert the
user of a wrong address entered...?

That won't work. I just typed a non-existent street address for my
street, and google maps quickly showed me the woods nearby, where no
house exists.

And you will never be able to check for valid names.

I run the computers for an annual event's registration, where there are
normally a bit over a thousand people. Using my up-to-date US and
Canadian zip/postal code databases, I always get forms with zip and
postal codes not in the latest databases. Whether or not the people are
writing down correct numbers (and letters), I have no way to tell. So I
accept them, and add them to the database with a marker signifying
'added at the event.' Then I check later...
 
V

vunet.us

Scripsit (e-mail address removed):


What if you read comprehensively the answer given to you, instead of quoting
it comprehensively but not uttering anything that suggests that you
understood a word of it?
Your suggestion was comprehensively understood. I'll try to follow
your advice. Thanks.
 
V

vunet.us

What happens is that the next quarterly subscription update to the
zipcode database should reflect the new codes. ;-)


That won't work. I just typed a non-existent street address for my
street, and google maps quickly showed me the woods nearby, where no
house exists.

And you will never be able to check for valid names.

I run the computers for an annual event's registration, where there are
normally a bit over a thousand people. Using my up-to-date US and
Canadian zip/postal code databases, I always get forms with zip and
postal codes not in the latest databases. Whether or not the people are
writing down correct numbers (and letters), I have no way to tell. So I
accept them, and add them to the database with a marker signifying
'added at the event.' Then I check later...

Thank you for sharing your experience. Well, if manual check is still
the final touch, perhaps, there is a way to get rid of international
spammers who register with Indianapolis, FL, 11133 USA? What would you
suggest considering the fact I have no geographical database (yet)?
 
B

Beauregard T. Shagnasty

Thank you for sharing your experience. Well, if manual check is still
the final touch, perhaps, there is a way to get rid of international
spammers who register with Indianapolis, FL, 11133 USA?

Familiarity would tell you straight away that 11133 should be on Long
Island. But it isn't... being a non-used number. So your entry is bogus.

You could write logic that, if full five digits not found, looks at the
first three digits, and see if the state matches other codes in your
database beginning with the same three.

11101 through (but not inclusive) 11120 is Long Island City, and 11133
is not in the list at all.
What would you suggest considering the fact I have no geographical
database (yet)?

Purchasing a database is more or less painless, except to your credit
card. You buy, then download, so you get it right away.

http://www.zipcodeworld.com/zipcodepremium.htm
is now down to $99.95 for a year's subscription. The Basic is cheaper
but doesn't have latitude and longitude, which I use. When you purchase,
you choose what format (among several common ones) you want. I use the
FoxPro .DBF format, as I do my database work with Visual FoxPro. Most
offer ASCII text, Microsoft Excel, Microsoft Access and .DBF. Any of
these formats are convertible to others. A comma-delimited file would be
easy to import into a web server's MySQL database, for example.

Naturally, before you take this step, you would need to be able to write
server code, perhaps in PHP, to utilize it.

I'm a (now retired) RDBMS guy, so this is easy-peasy for me. :)
 
J

Joel Shepherd

Any [street address] checks have the risk of rejecting correct data.

Bingo.
What if I use google map to determine a valid address? I'd get HTML of
the map page with user-supplied 'loc' string and if google does not
find it (will contain string "No match found" inside) I will alert the
user of a wrong address entered...?

Here's the difficulty: new addresses are being created all the time, and
old addresses are being destroyed daily. No address verification system
is going to stay perfectly current and correct. So, the most you can
hope for is an estimate of a street address's correctness. I.e., if
you're dealing with a customer/visitor interactively, an address
verification service allows you to (in essence) ask the visitor "Is this
[insert service-provided address here] the address you mean?", or "Is
the address you want in this [list of street addresses]?". It cannot
tell you with certainty whether a given address is valid or not.
Ultimately, you need to rely on the customer/visitor's judgment for that.

A corollary is that using an address verification service to
automatically (i.e., with no human verification) validate and correct
addresses is dangerous.

All that said, you _can_ use Google to search for "address verification
software" and that might give you some guidance to what's out there.
 
J

J.O. Aho

Thank you for sharing your experience. Well, if manual check is still
the final touch, perhaps, there is a way to get rid of international
spammers who register with Indianapolis, FL, 11133 USA? What would you
suggest considering the fact I have no geographical database (yet)?

There is no trouble to enter a valid address, wikipedias has list of zipcodes,
even those new with the extra four numbers, so if a spammer really want to
spam on a site, they have no trouble to get the data needed to fool you.

When talking about spam, should tell you that USA is the country from where
over 50% of all spam is sent from, on second place you find china with almost
40%, so getting rid 90% of all spammers, block all USA and CHINA IP-numbers.
 
D

Dan

When talking about spam, should tell you that USA is the country from where
over 50% of all spam is sent from, on second place you find china with almost
40%, so getting rid 90% of all spammers, block all USA and CHINA IP-numbers.

There go over a billion potential customers...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top