dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: zipcodes

  1. #1
    Join Date
    Feb 2006
    Location
    Ft Lauderdale
    Posts
    299

    zipcodes

    I need to find a way i can type a zipcode like 33308 and get all the zipcodes around it like 100 miles

    any one where i can get a script like this?

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    I doubt you can find it, but give http://www.cflib.org/ a look. They MIGHT have it.

    ^_^

  3. #3
    Join Date
    Feb 2006
    Posts
    520
    Here is a script that I use all the time but you need to find a zip code database with latitudes and longitudes. Google it and you'll find it. This script will work with SQL database, access db may be bit different due to math.

    <cfquery name="passedzip" datasource="db" maxrows="1">
    SELECT zipcode, latitude, longitude FROM ZIPCODERADIUS
    WHERE ZIPcode >= '#zip#'
    </cfquery>

    <cfquery datasource="db" name="getZip" >
    SELECT zipcode
    FROM ZIPCODERADIUS
    WHERE 3963 * (ACOS((SIN(round(#passedzip.latitude#,3)/57.2958) * SIN(latitude/57.2958)) +
    (COS(round(#passedzip.latitude#,3)/57.2958) * COS(latitude/57.2958) *
    COS(longitude/57.2958 - round(#passedzip.longitude#,3)/57.2958)))) <= #URL.radius#
    ORDER BY zipcode
    </cfquery>

  4. #4
    Join Date
    Feb 2006
    Location
    Ft Lauderdale
    Posts
    299
    Thanks
    I will do that

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles