title: Print Result of a form on the same page with CodeIgniter
body: <p>i have this code for registration :</p>
  
  <p>a. controller</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php  
   class Manual extends CI_Controller {  
        public function __construct(){  
             parent::__construct();  
             $this-&gt;load-&gt;model("model_manual");  
        }       
        public function index(){  
        $this-&gt;insert();       
        }  
        public function insert()  
        {  
             $this-&gt;form_validation-&gt;set_rules('nama', 'Nama', 'required');  
       $this-&gt;form_validation-&gt;set_rules('npm', 'Npm', 'required');
             $this-&gt;form_validation-&gt;set_rules('matkul','Matkul','required');  
             if ($this-&gt;form_validation-&gt;run())  
             {       
             $register=$this-&gt;model_manual-&gt;insertdata($_POST);  
             if($register){  
                       echo "&lt;script&gt;alert('Input Sucessfully')&lt;/script&gt;";  
        }  
             }  
             $data['title']="Input data";  
    $data=array('isi'   =&gt;'home/manual_view');
    $this-&gt;load-&gt;view('layout/wrapper',$data);       
        }  
   }  
   ?&gt;  </code></pre>
  </div>
  </div>
  </p>
  
  <p>b. model</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php  
   class Model_manual extends CI_Model {  
    function insertdata($options = array()){  
             if(isset($options['nama']))  
                  $this-&gt;db-&gt;set('nama',strip_tags($options['nama']));  
             if(isset($options['npm']))  
                  $this-&gt;db-&gt;set('npm',strip_tags($options['npm']));   
             if(isset($options['matkul']))  
                  $this-&gt;db-&gt;set('matkul',($options['matkul']));  
                  $this-&gt;db-&gt;insert("tabel_manual");  
             return $this-&gt;db-&gt;insert_id();  
    }  
     
    function cek_user($data) {
     $query = $this-&gt;db-&gt;get_where('tabel_manual', $data);
     return $query;
    }
    
    function getAllUser() {
    $this-&gt;db-&gt;from('tabel_manual');
    return $this-&gt;db-&gt;get();
    }
    
   }  
   ?&gt;  </code></pre>
  </div>
  </div>
  </p>
  
  <p>c. view</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class = "well" style = "background-color :lavender;"&gt;
  
  &lt;button class="btn btn-default" style= "padding-top : 9px; padding-bottom : 9px;"&gt;&lt;a href = "&lt;?php echo base_url(); ?&gt;home" style = "text-decoration : none;"&gt;&lt;span class="glyphicon glyphicon-home"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/button&gt;
  &lt;button class="btn btn-default"&gt;&lt;a href = "&lt;?php echo base_url(); ?&gt;blanko" style = "text-decoration : none;"&gt;&lt;span class="glyphicon glyphicon-list-alt"&gt;&lt;/span&gt; Blanko&lt;/a&gt;&lt;/button&gt;
  
  &lt;div class = "row"&gt;
  &lt;div class = "col-sm-offset-3 col-sm-6" style = "text-align : center"&gt;
  &lt;label style = "font-size: 20px;"&gt;INPUT DATA&lt;/label&gt;
  &lt;/div&gt;
  
  &lt;div class = "row"&gt;
  &lt;div class = "col-sm-offset-4 col-sm-4"&gt;
  &lt;form class="form-horizontal" action="" method="post" style = "margin : 10px;"&gt;
    
    &lt;div class="form-group"&gt;
    &lt;label style = "font-family : cambria;"&gt;Nomor Pokok Mahasiswa :&lt;/label&gt;
    &lt;input style = "font-family : cambria;" type="text" class="form-control" placeholder = "Typehere"
    name="npm" id="npm"/&gt;
    &lt;font color="#FF0000"&gt;&lt;?php echo form_error('npm');?&gt;&lt;/font&gt;
    &lt;/div&gt;
    
    &lt;div class="form-group"&gt;
    &lt;label style = "font-family : cambria;"&gt;Nama Lengkap :&lt;/label&gt;
    &lt;input style = "font-family : cambria;" type="text" class="form-control" placeholder = "Typehere"
    name="nama" id="nama"/&gt;
    &lt;font color="#FF0000"&gt;&lt;?php echo form_error('nama');?&gt;&lt;/font&gt;
    &lt;/div&gt;
      
    &lt;div class="form-group"&gt; 
    &lt;label style = "font-family : cambria;"&gt;Mata Ujian :&lt;/label&gt;
    &lt;select class="form-control" name="matkul" id="matkul"&gt;
    &lt;option value=""&gt;Select&lt;/option&gt; 
    &lt;option value="pancasila"&gt;Pancasila&lt;/option&gt;  
    &lt;option value="matdas2"&gt;Matematika Dasar 2&lt;/option&gt;
    &lt;option value="ap2"&gt;Algo.Pemograman 2&lt;/option&gt;
    &lt;option value="ap3"&gt;Algo.Pemograman 3&lt;/option&gt;
    &lt;option value="matif4"&gt;Matematika Informatika 4&lt;/option&gt;
    &lt;option value="sisber"&gt;Sistem Berkas&lt;/option&gt;
    &lt;option value="arkom"&gt;Arsitektur Komputer&lt;/option&gt;
    &lt;option value="jarkom"&gt;Jaringan Komputer&lt;/option&gt;
    &lt;option value="si"&gt;Sistem Informasi&lt;/option&gt;
    &lt;option value="so"&gt;Sistem Operasi&lt;/option&gt;
    &lt;option value="imk"&gt;IMK&lt;/option&gt;
    &lt;option value="sbd2"&gt;SBD 2&lt;/option&gt;
    &lt;option value="tbo"&gt;TBO&lt;/option&gt;
    &lt;option value="rpl2"&gt;RPL 2&lt;/option&gt;
    &lt;/select&gt; 
    &lt;font color="#FF0000"&gt;&lt;?php echo form_error('matkul');?&gt;&lt;/font&gt;
    &lt;/div&gt;
    
    &lt;br&gt;
    &lt;div class="form-group"&gt; 
          &lt;button type="submit" class="btn btn-default" style = "font-family : cambria; "&gt;Input&lt;/a&gt;&lt;/button&gt;
    &lt;button type="reset" class="btn btn-default" style = "font-family : cambria;"&gt;Reset&lt;/button&gt;
    &lt;/div&gt;
   &lt;/div&gt;
   &lt;/div&gt;
   &lt;/form&gt;
   
   &lt;/div&gt;
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>for the view, i use bootstrap to make design of my interface. 
  the question is... how can i print the result from the form went i "click" the submit button in the same page? </p>
  
  <p>i just want to make form, and after that below that form, i can showing the result.</p>