Basic Codeigniter search problem

Discussion in 'PHP' started by danramosd, Sep 10, 2010.

  1. #1
    Is there a way i can preform a search without using javascript in codeigniter? For example, i want to build an advanced search where people can search by name, state and a couple other criteria. I've been looking at the URI class for this and it seems like it can do everything I want. The only problem is that the data from my form gets sent via POST and not GET. I want the user to be able to submit their form and have a url like '/search/name/mike_smith/state/New_Jersey'. I know that I can take the post data and run the assoc_to_uri() function to create this url but then I have to do a redirect. Is that the proper way to do this? My other question is that if the user wants to leave one of the fields blank i end up with double slashes like 'search/name//state/New_Jersey' is there a way to remove it if there is data for that specific criteria? THANKS!
     
    danramosd, Sep 10, 2010 IP