Guest User

Untitled

a guest
Mar 20th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public function addPerson(){
  2. $username = $this->input->post('username');
  3. $password = $this->input->post('password');
  4. $accesslevel = $this->input->post('accesslevel');
  5.  
  6. if (strlen($username) < 1)
  7. {
  8. $data['myerror'] = "The Username field is required.";
  9. }
  10. if(strlen($data['myerror'])==0)
  11. {
  12. $this->db->query("INSERT INTO usersas6 "."(compid,username,password,accesslevel) VALUES "."(null,'$username', '$password', '$accesslevel')");
  13. $this->getAllPerson();
  14.  
  15. //are you trying to put it in the view? or this is your model?
  16. $this->template->show('Admin', $this->TPL);
  17. }
  18. if(strlen($data['myerror']) != 0){
  19. //This line may caused your error, what is this line for?
  20. $this->TPL["myError"] = $myerror;
  21.  
  22. $this->getAllPerson();
  23. $this->template->show('Admin', $this->TPL);
  24. }
  25. }
Add Comment
Please, Sign In to add comment