How to pass form value to model on codeigniter
<p>I'm working with codeigniter, I want to pass value from view to model, but it always give 0 value when i insert to table.</p>

<p>Below my form view</p>

<pre><code>&lt;div class="content"&gt;
  &lt;div class="row"&gt;
    &lt;div class="col-sm-6"&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="firstname"&gt;Firstname&lt;/label&gt;
        &lt;input type="text" class="form-control" id="firstname" name="firstname" &gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-sm-6"&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="lastname"&gt;Lastname&lt;/label&gt;
        &lt;input type="text" class="form-control" id="lastname" name="lastname" value="&lt;?= set_value('lastname') ?&gt;"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="row"&gt;

    &lt;div class="col-sm-6"&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="street"&gt;Address&lt;/label&gt;
        &lt;textarea class="form-control" id="address" cols="9" rows="4" name="address"&gt;&lt;?= set_value('address') ?&gt;&lt;/textarea&gt;

      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- /.row --&gt;
&lt;/div&gt;


&lt;?= anchor('welcome/clear_cart', 'Clear Cart', ['class' =&gt; 'btn btn-danger']) ?&gt; 
&lt;?= anchor(base_url(), 'Continue Shopping', ['class' =&gt; 'btn btn-primary']) ?&gt; 
&lt;?= anchor('order', 'Check Out', ['class' =&gt; 'btn btn-success']) ?&gt;
</code></pre>

<p>From this view i want to pass value of the form to "order" controller.</p>

<p>Bellow my "order" controller</p>

<pre><code>public function index()
{
    $is_processed = $this-&gt;model_orders-&gt;process();
    if($is_processed){
        $this-&gt;cart-&gt;destroy();
        redirect('order/success');
    } else {
        $this-&gt;session-&gt;set_flashdata('error','Failed to processed your order, please try again!');
        redirect('welcome/cart');
    }
}
</code></pre>

<p>Then controller will pass value to "model_orders->process()"</p>

<p>Below code of model_order function process()</p>

<pre><code>$data_delivery = array(
    'first_name' =&gt; $this-&gt;input-&gt;post('firstname'),
    'lastname_name' =&gt; $this-&gt;input-&gt;post('lastname'),
    //more
);

$this-&gt;db-&gt;insert('deliveryorder', $data_delivery);
</code></pre>

<p>So when i executed insert, the value which from view doesn't appear in model. 
first_name variable have '0' value, also another variable.</p>

<p>How i can get it works ? so i can get value from form view than from model i can insert to my table ?</p>