How To: Make Directory Search or browse by County & State

Discussion in 'PHP' started by thundercow, Mar 9, 2008.

  1. #1
    Hi there, I'm a Noob!

    Now that we got that out of the way, what is in principle, the way to make a yellow pages type directory searchable by county or state? I want to start a directory of lawyers and lawfirms and I'd like to use PHPld with some modifications. This page shows a directory searchable by area of law and searchable by county: http://lawyers.findlaw.com/

    So far, I know that I have to add extra fields to the database, and extra fields to the templates so that the extra fields can be filled in, and can be displayed when someone searches or browses results.

    So, I would need some sort of dump with all the states, and then within the states, all the counties, right?

    And, if the script had no template that allows for browsing by state and then county, I"d have to write one, correct?
     
    thundercow, Mar 9, 2008 IP
  2. 00johnny

    00johnny Peon

    Messages:
    149
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How you would want to do this is have two php pages ( or at least how I would do it )
    a search page
    and a results page.

    The search page will allow the user to select city, state, whatever
    then it will pass this data onto the results page

    The results page will then query the database for all the lawyers in that area
    then display that data in a table, here is a ruff example:
    
    layer       | phone    | ( Search Field )
    joe bob     | 555-1234 | (some var)
    bob joe     | 555-4321 | (some var)
    
    Code (markup):
    Then in the last column 'Search Field', you make it dynamic to change to whatever the search criteria was.
     
    00johnny, Mar 10, 2008 IP