title: Codeigniter POST Form Submit Problems
body: <p>I just started learning CI and PHP and wanted to make a simple CRUD application. </p>
  
  <p>I created a function to add a record, but when i submit the data in the form, Chrome downloads a file with no extension.</p>
  
  <p>Controller</p>
  
  <pre><code>&lt;?php
  
  class Options extends CI_Controller{
  
  function index()
  {
      $this-&gt;load-&gt;view('options_view');
  
  }
  
  function create()
  {
      $data = array(
  
          'name' =&gt; $this-&gt;input-&gt;post('name'),
          'price' =&gt; $this-&gt;input-&gt;post('price'));
  
      $this-&gt;data_model-&gt;addItem($data);
      $this-&gt;index();
  }
  
  }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>&lt;?php
  
  class Data_model extends CI_Model {
  function getAll() {
  $q = $this-&gt;db-&gt;query("SELECT * FROM items");
  if($q-&gt;num_rows() &gt;0){
      foreach($q-&gt;result() as $row){
          $data[]=$row;
      }
  }
  return $data;
  }
  
  function addItem($data){
      $this-&gt;db-&gt;insert('items', $data);
      return;
  }
  }
  ?&gt;
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
  &lt;style type="text/css"&gt;
  label {display: block;}
  &lt;/style&gt;
  
  
  &lt;h2&gt;Create&lt;/h2&gt;
  &lt;?php echo form_open('options/create'); ?&gt;
  
  &lt;p&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;&lt;input type="text" name="name" id="name" /&gt;
  &lt;/p&gt;
  &lt;p&gt;
      &lt;label for="name"&gt;Price&lt;/label&gt;&lt;input type="text" name="price" id="price" /&gt;
  &lt;/p&gt;
  
  &lt;p&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/p&gt;
  
  &lt;?php echo form_close(); ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is there something that i did wrong?
  No errors pop out. The form is created, but when i add data in the textboxes and click submit, the browser dowloands a "Create" file.</p>