Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help Creating a Search Box (zip codes) within my site.

    OK first off, I'm sorry if this topic was covered before, but I really need some help...

    I'm creating a website and one of the requirements is that there should be a seach box situated in the left nav, where the user can type in their zip codes. The search would then automatically bring the user to one of the 50 state pages already created throughout my site, saying something like "congratulations there are multiple dealerships near xxxxx (zip code). (This can't be a google search engine either...just type in your zip and it brings to whatever state page that zip code falls under)

    I don't know where to begin as I'm not really familiar with this sort of thing and was hoping to see if anyone had a suggestion, or tutorial or anything like that....

    any help would be greatly appreciated. Thanks!

  • #2
    New Coder
    Join Date
    Dec 2006
    Location
    Denver, Colorado
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Get your hands on a database of Zip Codes and their associated states. Some of these also include latitude/longitude information if you later want to perform the math to determine which dealership is *closest* to that zip code, but it doesn't sound like you're going that route just yet.

    Once you've got a table set up with all the zip codes, the query then becomes "SELECT state FROM {{table name}} WHERE zip_code = '{{submitted zip code}} LIMIT 1" and do a redirect off of that returned result.

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much...I really appreciate you responding to my post. You've given me that starting point I needed badly...i'll let you know how it turns out....Thank you again!


  •  

    Posting Permissions

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