Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - Postcode check if it's covered

I am currently developing a website for an electrical company. They would like some sort of postcode check on there. It would somehow work like this:

  1. User enters postcode
  2. See if we cover it
  3. display results.

But I have never worked with postcodes before. How would I be able to check whether they cover it. I obviously need some sort of database listing the postcode or area they cover. But how would I also check if the postcode is valid.

The postcode lookup is obviously to see if the electrical company covers the user's area.

Thanks in advance.

like image 337
ryryan Avatar asked Oct 10 '22 22:10

ryryan


1 Answers

I think instead of using a database to search your results, you would be better of looking at geo location, and using a 3rd party to calculate everything for you.

Google and Sony both provide Geo Location platforms

  • Sony has: http://www.placeengine.com/en
  • Google has: http://code.google.com/apis/maps/documentation/distancematrix/
like image 175
RobertPitt Avatar answered Oct 18 '22 09:10

RobertPitt