title: how do i pass a view variable to the controller in codeigniter?
body: <p>My View :-</p>
  
  <pre><code> &lt;html&gt;
  &lt;?= link_tag(base_url().'css/simple.css'); ?&gt;
  &lt;body&gt;
  &lt;?php $this-&gt;load-&gt;helper('form'); ?&gt;
  &lt;?php $this-&gt;load-&gt;view('commentform'); ?&gt;
  &lt;?php $id=$this-&gt;uri-&gt;segment(3);?&gt;
  &lt;?php echo $id;?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i would like to use the variable <code>$id</code> in my controller.I'm using codeigniter by the way, and am a beginner. I would appreciate any help on this.</p>