Thread: Zip

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    121
    Rep Power
    9

    Zip


    Working on a project that I want to be able to enter a zipcode into and see whether or not someone offers a service in the area. I am guessing the simplest way to do this would be a simple if/else to search through a database to see if the zipcode entered exists on a list. I have not chosen a design language yet. It's going to either be php or C#.net. I have never done anything with zipcodes so I'm debating on what stlye code would make this easiest and whether to hard code the zip codes or just have a database table with a list of the "good" zipcodes. If you have suggestions I'd appreciate any insight! Thanks
  2. #2
  3. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    I am guessing the simplest way to do this would be a simple if/else to search through a database to see if the zipcode entered exists on a list.
    You mean

    Code:
    If zip = 94610 Then
      //
    ElseIf zip = 94105 Then
     //
    ElseIf 
     // ad nauseum
    ?

    How about

    Code:
    SELECT * FROM MyData WHERE zipcode = 94610;
    I believe some government agency and/or the US postal service might have data you can use.

    Comments on this post

    • groghscv agrees
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    121
    Rep Power
    9
    That's kinda the idea I was going after. My concern is collecting all that data. Like you said, maybe one of the .gov sites can give me that list. The SQL method is probably the simplest because you just need a list of supported zip codes and if it is not in the DB table you dump the user to a page saying "this service is not available in your area" or something like this. Thanks for the reply. It gives me something else to think about.
  6. #4
  7. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    Actually a list of zip codes, unless you're looking for proximity data, shouldn't be required. You have a list of service providers and their zip codes presumably if that's what you're searching, you don't need a lookup list. If you want a database that does proximity data I think you're going to have to license this.

    I once did a work related project (so I can't share) that tapped terraserver and used GPS coordinates and great circle distance calculation to calculate the distance between two street addresses. You could license terraserver data and do similar. I could tell you how, I just can't share my code since even though I wrote it, it's not mine.
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

IMN logo majestic logo threadwatch logo seochat tools logo