title: CodeIgniter form_validation->run() always returns false?
body: <p>I'm new to <code>CodeIgniter</code> and I've been trying to implement a form submitting function, however whenever I press "submit" the form page simply refreshes and the database is not updated! It seems that the <code>$this-&gt;form_validation-&gt;run()</code> is always returning false, but I have no idea why. </p>
  
  <p>The <strong>controller</strong> function is as follows:</p>
  
  <pre><code>public function write_prof_review($prof_id)
      {
          $this-&gt;load-&gt;model('Queries');
          // form stuff here
          $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;library('form_validation');
  
          $data['prof_id'] = $prof_id;
          if($this-&gt;form_validation-&gt;run() == FALSE){
              $this-&gt;load-&gt;view('create_prof_review', $data);
          }
          else {
              $this-&gt;Queries-&gt;submit_prof_review($prof_id, $this-&gt;USERID);
              $this-&gt;load-&gt;view('form_submitted');
          }       
      }
  </code></pre>
  
  <p>And here is the function submit_prof_review() in the <strong>model</strong>:</p>
  
  <pre><code>function submit_prof_review($prof_id, $user_id)
      {
          $data = array(
              'course_code' =&gt; $this-&gt;input-&gt;post('course_code'),
              'easiness' =&gt; $this-&gt;input-&gt;post('easiness'),
              'helpfulness' =&gt; $this-&gt;input-&gt;post('helpfulness'),
              'clarity' =&gt; $this-&gt;input-&gt;post('clarity'),
              'comment' =&gt; $this-&gt;input-&gt;post('comment')
          );
  
      $average = round((($data['easiness'] + $data['helpfulness'] + $data['clarity'])/3),2);
      date_default_timezone_set('Asia/Hong_Kong');
      $date = date('m/d/Y h:i:s a', time());
  
      $data['average'] = $average;
      $data['date'] = $date;
      $data['course_id'] = 0; 
  
      return $this-&gt;db-&gt;insert('review_prof', $data);
  }
  </code></pre>
  
  <p>And finally the view for the form (create_prof_review.php):</p>
  
  <pre><code>&lt;h2&gt;Write a review&lt;/h2&gt;
  &lt;?php echo form_open('home/write_prof_review/'.$prof_id); ?&gt;
  &lt;h3&gt;Course code
  &lt;input type = 'text' name = 'course_code'&gt;&lt;/h3&gt;
  &lt;h3&gt;Easiness
  &lt;input type = 'text' name = 'easiness'&gt;&lt;/h3&gt;
  &lt;h3&gt;Helpfulness
  &lt;input type = 'text' name = 'helpfulness'&gt;&lt;/h3&gt;
  &lt;h3&gt;Clarity
  &lt;input type = 'text' name = 'clarity'&gt;&lt;/h3&gt;
  &lt;h3&gt;Comment&lt;/h3&gt;
  &lt;textarea name = 'comment' rows = '4' cols = '50'&gt;&lt;/textarea&gt;
  &lt;br&gt;
  &lt;input type = 'submit' name = 'submit' value = 'Submit'&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Been stuck on this for a couple of days, but I still can't figure out what's wrong. Any help would be greatly appreciated!</p>