Having trouble with Search Form

Discussion in 'Programming' started by ki3000, Oct 29, 2009.

  1. #1
    Hi. I am having trouble with my search form. I want to search for cities (any where), and it's working perfectly fine if I search for a one word city, i.e. atlanta, miami, denver, but then when I search for cities (or states) w/ 2 or more words words: i.e. new york city, san diego, north carolina, everything totally messes up. the url comes like this for: http: //www...com.../san+diego and this messes up everything (it doesn't give me the right city) but i tried putting a + in the middle of the words: i.e. san+diego; and it gave me the correct results... here is the new url: http: //www...com...//san%2Bdiego so in a nutshell, how do i change the search form (if i can that's) to target the second url: san%2Bdiego instead of san+diego?

    Thanks all.
     
    ki3000, Oct 29, 2009 IP
  2. urstop

    urstop Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You will have to URL encode the variable which will replace the space with %2B.
     
    urstop, Oct 30, 2009 IP
  3. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
  4. ki3000

    ki3000 Active Member

    Messages:
    361
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Exactly how do i do this. I am not really an expert in coding. I just know html, and simple php.

    Thanks again (both) for you imput.
     
    ki3000, Nov 1, 2009 IP
  5. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #5
    i would split them and search for both new and york in same column, then parse the hits them in what ever language you´re using.. that way you can give "hints" on things that´s related to their search

    it´s more work but would be giving a better service for the users :cool:
     
    n3r0x, Nov 1, 2009 IP
  6. ki3000

    ki3000 Active Member

    Messages:
    361
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Sorry, I don't understand what you mean by this... here is the site i am talking about... you can try searching any city and it will give you the correct results, but if you use a city or state with more than one word, it will get results from different places and not from that area (for example, new york)

    HERE IS THE SITE
     
    ki3000, Nov 28, 2009 IP