Guest User

Untitled

a guest
Jan 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.     public function _add_comment()
  2.     {
  3.         if ($this->input->post('submit_comment'))
  4.         {
  5.             $comment = array(
  6.                 'class'     => $this->input->post('class'),
  7.                 'parent_id' => $this->input->post('parent_id'),
  8.                 'title'     => $this->input->post('title'),
  9.                 'text'      => $this->input->post('text'),
  10.             );
  11.  
  12.             $this->load->model('comments/commentus_form_m');
  13.  
  14.             if ($this->commentus_form_m->is_valid($comment))
  15.             {
  16.                 die('Valid!');
  17.  
  18.                 $this->load->model('comments/commentus_m');
  19.                 $this->commentus_m->insert($comment);
  20.             }
  21.             else
  22.             {
  23.                 echo validation_errors();
  24.                 print_r($comment);
  25.                 die('Not valid');
  26.             }
  27.         }
  28.     }
Add Comment
Please, Sign In to add comment