Adding comments to a post |
[eluser]Lykos22[/eluser]
Hi all, I'd like some help please, I 've completly stuck! I have a post page that has the full post and below the post a small form for adding comments. The uri of the post page is: site/posts/1, so it is in posts controller, and the form action is form_open(site_url('comments/add/'.$post->post_id)). This is my add() function inside comments controller: Code: public function add($post_id){ and this is the add() function inside the comment model: Code: public function add($post_id){ What I'm trying to do is if the $result = $this->comment_model->add($post_id); fails the validation to display the validation errors in my post view, else insert the comment and redirect to the same post page (site/posts/1). The problem is that when I hit submit the form action goes in the comments/add/1, as expected, but doesn't do any these above. Any ideas how can I fix this?? Can also found here |
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
|