Question about setting up a search on a website????

Discussion in 'Web Design and Development' started by jbuttons, Oct 19, 2008.

  1. jbuttons macrumors newbie

    Joined:
    Nov 7, 2007
    #1
    Hello to all, I am in the process of finishing a website for a dental insurance company. They have just asked me if I could add a search screen that customers would be able to type in their zip code and a list of the dentist within a certain area would pop up. So I would have to put in all the names in their database and the search be able to just pick certain ones that are in the area specified by the zip code.I am using Dreamweaver and was not sure if this could be done in there or if I would have to use php or something else . Any info would be greatly appreciated. Thanks In Advance:apple:
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    You'll need a server side language like PHP that can communicate with the database. You could also use Perl, Python, or Ruby on Rails to name a few. PHP will have the most references online though.
     
  3. jbuttons thread starter macrumors newbie

    Joined:
    Nov 7, 2007
    #3
    Does the database have to be written in a specific program for the php program to read it or would it read from a certain file type? If possible could you layout the steps for me. Not the whole setup, just the steps in general.Thanks.
     
  4. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #4
    Generally MySQL is the favored database used with PHP, but there are other options like Oracle or PostgreSQL. It all depends on what your host supports really.

    For something simple like what you're doing, you could also forgo a database and store your data in a simple text file in comma-delimited or xml format on the server and have your PHP read the data from that file.

    As to your request for a step-by-step, that is a bit beyond the scope of a discussion board posting. However there are a million good sites out there to acquaint you with simple PHP / MySQL setup and programming.
     
  5. lucidmedia macrumors 6502a

    Joined:
    Oct 13, 2008
    Location:
    Wellington, New Zealand
    #5
    PHP and mySQL are a simple and widely supported method to create a database and run searches upon it.

    The problem you will run into, I fear, is that a database search like this needs to pull content based upon proximity. While it is easy to search for EXACTLY the same zip code, what if there is a office 3 miles away that happens to be in the next zip code? Your database will not return a result. This is bad.

    Having data returned in order of closeness is more difficult because your database needs to know what zip codes are close to each other. So, a search for 02472 may need to return offices in 02138 and 02453 -- two non-sequential zip codes that happen to abut the search location query.

    Take a look at Zipdy, an open source "Zip Code Distance Calculator" that you can run on a database. You can then use this field to filter your search results.
     
  6. ksb43 macrumors member

    Joined:
    Oct 15, 2008
    #6
    An alternative solution I used for a similar problem is to create a jump menu with all of the states listed and then the user can just select what state he/she is in and display all the offices in that state.

    It should be pretty easy to create the form and use PHP or a similar language to display the results which could come from a database or hardcoded right on the page if you want.
     
  7. jbuttons thread starter macrumors newbie

    Joined:
    Nov 7, 2007
    #7
    Thank you all for your responses. I found a company that makes little program that takes care of what I needed. Its a store locator script that I can add to the website in html code. Thanks Again.
     

Share This Page