Zip Code Entry Populates Next Page with City/State

efeezy

New member
Oct 5, 2007
5,250
136
0
50
Ok, first off, I'm the coding equivalent of a 2 year old, so go easy on me.

I'm trying to have a zip code field on one page and when the user clicks submit, it directs to another page which displays the city/state of that zip code. Exactly like what this site does Cheap Life Insurance from Top Providers - Cheaplifeinsure24. Sorry if I outed anyone's site by mistake.

I know that I will need to have the initial zip code form send the zip parameter to the action="nextpage.php". And I will need a zip/city/state list, which I have, but setting up the sql database and the page 2 script is where I'm completely lost. Is there a simpler way to pull this off. This is Wordpress by the way. Be gentle. Thanks.
 


Of course you outed someone's site... This is at least the second time that it has been done to this "individual"...
 
So we can't post a URL to any site around here because it might happen to be one of the 20,000 WF member's site? It's on page 4 for the search I did.

Mods, delete the damn url if you have to.

Here. Like this site http://www.geico.com. Hopefully it's not a WF member site.
 
Why would you want to do some peasant shit like have them enter their zip code anyhow?

Real men geolocate... Just sayin...
 
Your nextpage.php can take the zipcode passed in (nextpage.php?zip=33414) and plug that into a Geo api service. You can look into Address/Email validation services, most require fees.

Another option is using Google Maps API (v3) which, you may be able to pull an Address "suggestion" based on your zip.

I'm not 100%, but i've definitely used Google Maps API as a free alternative to Address validation - and it works well, but i'm not sure how 'partial' of an address you can get away with. (PHP/jQuery/Google maps API - are core technologies in this, if you should outsource.)

I only bumped this because this thread didn't really have solutions if someone were to search.

Goodluck, PM me if you need any help. :)

-PHP guy
 
geo locate isnt always good, it pisses off VPN users with an IP in city X while they are sitting across the country looking for a better auto insurance quote (been there)