Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ken Guest's Blog:
A response to "Better Postal/Zip Code Validation Method for CakePHP 1.2"
Dec 17, 2009 @ 17:14:53

In response to a different post he read on a postal/zip code validation topic, Ken Guest has points out other resources that can be used to accomplish the same sort of thing and already exist.

I drew attention to two things. The first is that there are Validation packages in PEAR, including the main Validate class and all the Validate_xx subclasses such as Validate_US, Validate_CA and some 22 others). The second item I drew Jamie's attention to is that his validation code counts a zip code of "00000' as valid, when the USPS zip code look up tool correctly (and they should know!) identifies that code as invalid.

He wholeheartedly opposes the "Not Invented Here" syndrome that developers (with a hefty dose of framework developers included) seem to have.

tagged: response zipcode postal validation pear lookup

Link:

Jason Palmer's Blog:
Zip Code To Location
Dec 28, 2006 @ 17:22:00

On his blog today, Jason Palmer has a handy bit of code to help you validate zip codes on your website (using the Codebump.com web service).

Using the CodeBump GeoPlaces Web Service I constructed a function which takes three parameters (zip, city, state) and does a case-insensitive comparison to make sure that the given zip code matches the city and state. Upon verification the function will return true. Otherwise, it returns false.

The simple code is about 35 lines long and grabs and parses out the information with a combination of an fopen and converting the results into an XML element.

tagged: zipcode location example codebump zipcode location example codebump

Link:

Jason Palmer's Blog:
Zip Code To Location
Dec 28, 2006 @ 17:22:00

On his blog today, Jason Palmer has a handy bit of code to help you validate zip codes on your website (using the Codebump.com web service).

Using the CodeBump GeoPlaces Web Service I constructed a function which takes three parameters (zip, city, state) and does a case-insensitive comparison to make sure that the given zip code matches the city and state. Upon verification the function will return true. Otherwise, it returns false.

The simple code is about 35 lines long and grabs and parses out the information with a combination of an fopen and converting the results into an XML element.

tagged: zipcode location example codebump zipcode location example codebump

Link:


Trending Topics: