title: codeigniter form not submitting data
body: <p>I have tried everything I can think of but whenever I click submit the form passes on a null value, I dont know if it is the problem with the form or the controller or even the view. I changed this->input->post to posted data and i get an error of undefined variable posted data, please help. </p>
  
  <p>Controller: </p>
  
  <pre><code> public function addmenu(){
  
      $this-&gt;load-&gt;model('organizer_model');
  
      $data = array(
                  'menu_name' =&gt; $this-&gt;input-&gt;post('menu name'), 
                  'price' =&gt; $this-&gt;input-&gt;post('price'),
                  'email' =&gt; $this-&gt;session-&gt;userdata('email')
  
              );
  
              if($this-&gt;organizer_model-&gt;insertmenu($data)) {
  
      $this-&gt;session-&gt;set_flashdata('message', 'Your menu has been added');
      redirect('/menu/index', 'refresh');
  
      } else {
  
      $this-&gt;session-&gt;set_flashdata('message', 'Your menu was not added, please try again');
      redirect('/menu/index', 'refresh');
      }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>              &lt;form action="&lt;?php echo site_url('Organizer/addmenu'); ?&gt;" method="post" class="form-horizontal no-margin"&gt;
  
                    &lt;div class="control-group"&gt;
                      &lt;label class="control-label" for="menuname"&gt;
                       Menu Name
                      &lt;/label&gt;
                      &lt;div class="controls controls-row"&gt;
                        &lt;input class="span3" name="data[menuname]" type="text" placeholder="Enter menu Name"&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
  
                    &lt;div class="control-group"&gt;
                      &lt;label class="control-label" for="price"&gt;
                        Price
                      &lt;/label&gt;
                      &lt;div class="controls controls-row"&gt;
                        &lt;input class="span3" name="data[price]" type="text" placeholder=""&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
  
                    &lt;div class="form-actions no-margin"&gt;
                      &lt;button type="submit" name="submit" class="btn btn-info pull-right"&gt;
                        Add menu
                      &lt;/button&gt;
                      &lt;div class="clearfix"&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
  
                  &lt;/form&gt;
  </code></pre>
  
  <p>Model: </p>
  
  <pre><code>   public function insertmenu($data) {
  
      $condition = "email = '" . $data['email'] . "'";
      $this-&gt;db-&gt;select('organizer_id');
      $this-&gt;db-&gt;from('organizer');
      $this-&gt;db-&gt;where($condition);
      $this-&gt;db-&gt;limit(1);
      $query = $this-&gt;db-&gt;get();
  
      if ($query-&gt;num_rows() &gt; 0){
  
          array_pop($data); //will remove email from data
  
          $row = $query-&gt;row();
          $data['organizer_id'] = $row-&gt;organizer_id;
  
          $this-&gt;db-&gt;insert('menu', $data);
          if ($this-&gt;db-&gt;affected_rows() &gt; 0) {
              return true;
          } else {
              return false;
          }
      } else {
          return false;
      }
  
  }
  </code></pre>