Welcome Guest, Not a member yet? Register   Sign In
Adding comments to a post
#2

[eluser]rappasoft[/eluser]
You seem to be returning an id on success but not checking if it was false or not:

This:

Code:
if ($this->form_validation->run() == true) {
   $this->comment_model->add($post_id);
   redirect('posts/'.$post_id);
  }

Could be this:

Code:
if ($this->form_validation->run() == true) {

   if ($id = $this->comment_model->add($post_id)) {
       redirect('posts/'.$id);
   } else {
        //Returned false, show errors
   }
  
}


Messages In This Thread
Adding comments to a post - by El Forum - 10-28-2013, 04:05 AM
Adding comments to a post - by El Forum - 10-29-2013, 07:11 AM
Adding comments to a post - by El Forum - 10-29-2013, 12:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB