title: passing variables in form_open() in codeigniter
body: <p>Good day all. I'm new to codeigniter and I'm trying to pass a variable from one <code>view</code> page to another. But I get error and after a lot of tries still couldn't figure it out.</p>
  
  <p>This is the <code>Model</code> code:</p>
  
  <pre><code>function get_post($postID){
      $this-&gt;db-&gt;select()-&gt;from('khanposts')-&gt;where(array('post_id'=&gt;$postID))-&gt;order_by('fullname', 'desc');
      $query=$this-&gt;db-&gt;get();
      return $query-&gt;result_array();
  }
  
  function update_post($postID, $data)
  {
      $this-&gt;where('post_id', $postID);
      $this-&gt;db-&gt;update('khanposts', $data);
  }
  </code></pre>
  
  <p>This is the <code>Controller</code> code:</p>
  
  <pre><code>function editpost($postID)
  {
      $data['success']=0;
      if($_POST){
          $data_post=array(
              'fullname'=&gt;$_POST['fullname'],
              'dob'=&gt;$_POST['dob'],
              'blood'=&gt;$_POST['blood'],
              'village'=&gt;$_POST['village'],
              'occupation'=&gt;$_POST['occupation'],
              'company'=&gt;$_POST['company'],
              'email'=&gt;$_POST['email'],
              'contact'=&gt;$_POST['contact'],
              'password'=&gt;$_POST['pass'],
              'marry'=&gt;$_POST['marry']);
          $this-&gt;khanpost-&gt;update_post($postID, $data);
          $data['success']=1;
      }
      $data['post']=$this-&gt;khanpost-&gt;get_post($postID);
      $this-&gt;load-&gt;view('edit_post', $data);
  }
  </code></pre>
  
  <p>This is the code of <code>View</code> page which passes the value to <code>edit_post</code> view page:</p>
  
  <pre><code>foreach ($posts as $row){
  &lt;tr&gt;&lt;td&gt;&lt;a href="' .base_url(). 'khanposts/editpost/' .$row['post_id']. '" target="_blank"&gt;&lt;i&gt;Edit&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;';
  }
  </code></pre>
  
  <p>This is code of <code>edit_post</code> view page where it must get the value of <code>$row['post_id']</code>:</p>
  
  <pre><code>echo form_open(base_url().'khanposts/editpost/'.$row['post_id']);
  echo '&lt;b&gt;Full Name: &lt;/b&gt;';
  $data_form=array('name'=&gt;'fullname', 'size'=&gt;30, 'id'=&gt;'fullname', 'class'=&gt;'inputstyle', 'value'=&gt;$row['fullname'] );
  echo form_input($data_form);
  </code></pre>
  
  <p>How do I assign the passsed variable(<code>$row['post_id']</code>) in <code>form_open()</code>? Any solution will be really helpful. Tnx.</p>