title: Pass a variable from one page to another in CodeIgniter
body: <p>In codeigniter, on the page <em>/categories</em> I have a table with the rows of all category items. There is a <code>&lt;select&gt;</code> box to filter the categories by components:</p>
  
  <pre><code>&lt;form accept-charset="utf-8" method="post" action="/categories/get_categories"&gt;
      &lt;select onchange="this.form.submit()" name="selectCatsByComponent"&gt;
          &lt;option value="0" selected="selected"&gt;-- Choose a component --&lt;/option&gt;
          &lt;option value="1"&gt;Content&lt;/option&gt;
          &lt;option value="2"&gt;E-commerce&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So whenever i select an <code>&lt;option&gt;</code> from the <code>&lt;select&gt;</code> list , and I click on the button <strong>ADD NEW CATEGORY</strong>, i want to pass that POST value into the next page and automatically select the corresponding component id in the same <code>&lt;select&gt;</code> list.</p>
  
  <p>I tried this but it seems not working:</p>
  
  <pre><code>    if( $this-&gt;input-&gt;post('selectCatsByComponent') )
          $com_id = $this-&gt;input-&gt;post('selectCatsByComponent');
  </code></pre>
  
  <p>Any tips ?</p>
  
  <p><strong>======= UPDATE =======</strong></p>
  
  <p>Guys, for those who are still in searching for a solution - check out my Template Library on GitHub:</p>
  
  <p><a href="https://github.com/danieltorscho/CI_Template_lib" rel="nofollow">https://github.com/danieltorscho/CI_Template_lib</a></p>
  
  <p>it does what you need, nothing, less, nothing more.</p>