Php – jQuery and/or PHP location finder: zip code and city/state


I'm looking to auto-populate a form input textarea with the user's city, state. I also need the zip code to pass with the form. I don't need a map.

Any suggestions? (I prefer jQuery and/or PHP.)

I discovered this little js to get the city, state, latitude, longitude, area code, etc… except it doesn't get the zip. Probably because a lot of cities have multiple zips. But all I need is one zip from the city… it doesn't matter which one, because I'm grabbing data within a 50 mile radius. So is there anyway to take this script below and find a zip from the location based on the data that it returns.

    <script language="JavaScript" src="" type="text/javascript"></script>
    <script language="Javascript"> 
document.write("Welcome to our visitors from "+geoplugin_city()+", "+geoplugin_region()+", Area code = "+geoplugin_areaCode()+", Latitude = "+geoplugin_latitude()+geoplugin_areaCode()+", Longitude = "+geoplugin_longitude()); 

Source: GeoPlugin

Best Solution

You can use GeoLite City to convert the user's IP into the City, State Zip