title: Codeigniter: Submit parameters to controller, need correct URI
body: <p>I have a form with 4 dropdowns and a submit button. When a user clicks the submit button I want to go to my controller handling the input/output giving the users choices, but with a correct URI.</p>
  
  <p>The dropdowns are dynamically generated from Ajax depending on the users choices, bar the first dropdown. They are working absolutely fine.</p>
  
  <p>The method handling the user input is located in this controller: <code>/app/controllers/shop/kategorier</code>, <strong>index method looks like this:</strong></p>
  
  <pre><code>public function index($fabrikat, $type, $model, $produktnr = '0')
  {
      // get all the data from the model
      $data['all'] = $this-&gt;fetch-&gt;get_kategorier($fabrikat, $type, $model, $produktnr);
  
      print_r($data['all']);      
  }
  </code></pre>
  
  <p><strong>My goal is this:</strong> When users hit the submit button, I wan't them to view the page with that exact URL <strong><em>including</em></strong> the parameters, eg. <a href="http://app.com/shop/kategorier/index/LG/WASH/FL9834X/0/" rel="nofollow">http://app.com/shop/kategorier/index/LG/WASH/FL9834X/0/</a> That's all I really want.</p>
  
  <p><strong>Note:</strong> Accessing this URL manually works fine, and the controller/model handles the parameters as they should.</p>
  
  <p><em>How</em> do I accomplish this? I tried two things, they both failed. Sort of. </p>
  
  <ol>
  <li><p>I tried with jQuery, and generated a encodedURL string with all the
  parameters with a '/' delimiter, and changed the .attr('href') on
  submit. But that was a nightmare, since some of the $model's can be
  eg. <code>'CE1000C-T / XEE'</code> etc.</p></li>
  <li><p>I tried to make a 'proxy' method in the Kategorier
  controller taking all the input->posts and appending them to a
  <code>redirect('kategorier/'.$fabrikat.'/'.$etc)</code>, but that was rather
  stupid.</p></li>
  </ol>
  
  <p>I would rather not use query strings like <code>/kategorier?fabrikat=LG&amp;type=WASH</code> etc</p>
  
  <p><strong>My form looks like this:</strong></p>
  
  <pre><code>&lt;?php echo form_open('shop/kategorier/'); ?&gt;
  
  &lt;select id="fabrikat" name="fabrikat"&gt;
      &lt;option name="0"&gt;Vælg Fabrikat&lt;/option&gt;
      &lt;?php foreach ($fabrikater as $f) : ?&gt;
          &lt;option value="&lt;?php echo $f-&gt;Fabrikat; ?&gt;" name="&lt;?php echo $f-&gt;Fabrikat; ?&gt;"&gt;&lt;?php echo $f-&gt;Fabrikat; ?&gt;&lt;/option&gt;
      &lt;?php endforeach; ?&gt;
  &lt;/select&gt;
  
  &lt;select id="type" name="type"&gt;
  &lt;/select&gt;
  
  &lt;select id="model" name="model"&gt;  
  &lt;/select&gt;
  
  &lt;div id="produktnummer-wrap" style="display:none"&gt;
      &lt;select id="produktnummer" name="produktnummer"&gt;
          &lt;option name="0" value=""&gt;Vælg Produktnummer&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  
  &lt;?php echo form_submit('findparts', 'Find Reservedele'); ?&gt;
  &lt;?php echo form_close(); ?&gt;
  </code></pre>
  
  <p>I believe I'm somehow overcomplicating things, but right now I can't think straight. I will be more than happy to elaborate anything.
  I really hope someone is able to help me out, thanks in advance.</p>