Beispiel #1
0
 public function xhrInsert()
 {
     $text = my_sanitize($_POST['my_text']);
     $this->db->insert('ajaxdata', array('yourtext' => $text));
     $nice = array('text' => $text, 'id' => $this->db->lastInsertId());
     echo json_encode($nice);
 }
Beispiel #2
0
 public function create()
 {
     $data = array();
     if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['role'])) {
         $data['useR'] = my_sanitize($_POST['username']);
         $data['passW'] = my_sanitize($_POST['password']);
         $data['rolE'] = my_sanitize($_POST['role']);
     }
     $this->model->create($data);
     header('location: ' . URL . 'user');
 }
Beispiel #3
0
 public function editSave($nid)
 {
     $data = array('titlE' => my_sanitize($_POST['title']), 'contenT' => my_sanitize($_POST['content']), 'iD' => $nid);
     $this->model->editSave($data);
     header('Location: ' . URL . 'note');
 }