title: How to send php variable from view(html) to controller
body: <p>This is my html code. I want to pass "<code>$category_edit-&gt;c_name</code>" value to my <code>Update()</code> controller. I am getting "<code>$category_edit</code>" variable from another controller.</p>
  
  <p>I am using CodeIgniter framework.</p>
  
  <pre><code>&lt;form method="post" action="&lt;?php echo base_url('admin/category/update');?&gt;"&gt;
   &lt;label&gt;Parent Category: &lt;/label&gt;&lt;/br&gt;
   &lt;select name="parent_id"&gt;
   &lt;?php
      echo '&lt;option value="' .$category_edit-&gt;id .'"&gt;';
      echo $category_edit-&gt;p_name;
      echo '&lt;/option&gt;';
   ?&gt;
   &lt;/select&gt;
   &lt;label&gt;Category&lt;/label&gt;
   &lt;input type="text" name="&lt;?php echo $category_edit-&gt;c_name; ?&gt;" id="category_name" value="&lt;?php echo $category_edit-&gt;c_name; ?&gt;"&gt;
   &lt;button&gt;Update&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my <code>update()</code> controller. 
  I am getting Error:  </p>
  
  <ol>
  <li>Undefined variable: category_edit  </li>
  <li><p>Trying to get property of non-object</p>
  
  <pre><code>public function update(){
     $this-&gt;load-&gt;model('category_model');
     echo $category_edit-&gt;c_name;
  }
  </code></pre></li>
  </ol>