0

I have the following form:

<form name="frmSearch" method="get" action="">
     <input type="text" name="firstName" value="John" />
     <select name="criteria">
           <option value="-1">Select Criteria</option>
           <option value="1">By Name</option>
           <option value="2">By Email</option>
     </select>
     <select name="status">
           <option value="-1">Select Status</option>
           <option value="0">Inactive</option>
           <option value="1">Active</option>
     </select>
</form>

After submitting the form. The values comes in the URL like this:
http://www.example.com/index.php/search/?firstName=John&criteria=1&status=1
but I want the URL in a Key Value Pair like this:
http://www.example.com/index.php/search/firstName/John/criteria/1/status/1

Can anyone help me regarding this:

Masood Anwar
  • 73
  • 10
  • You'll either have to make this in javascript, or build the url then redirect to it after submit. – ahmad Dec 22 '13 at 14:32
  • Yes, that is the way but not the professional way of doing this... – Masood Anwar Dec 22 '13 at 16:33
  • http://stackoverflow.com/questions/14317440/how-to-convert-query-string-to-segment-uri – Nouphal.M Dec 22 '13 at 18:17
  • are you going to use pagination after all this? if so I suggest you watch this tutorial http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-search-results-without-query-strings-2/ – Kyslik Dec 23 '13 at 09:50

0 Answers0