Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. function register()
  2. {
  3.  
  4.  
  5. if(isset($_POST['register'])){
  6.  
  7. $this->form_validation->set_rules('username','Username','required');
  8. $this->form_validation->set_rules('email','Email','required');
  9. $this->form_validation->set_rules('password','Password','required');
  10. //
  11. if($this->form_validation->run () == true){
  12. echo 'Form Validate';
  13.  
  14. $data = array(
  15. 'username'=>$_POST['username'],
  16. 'email'=>$_POST['email'],
  17. 'password'=>strtoupper(hash('whirlpool',$_POST['password']))
  18. );
  19.  
  20. $this->db->insert('accounts',$data);
  21. $this->load->model("usuarios_model");
  22. if($this->usuarios_model->check_user_exist($data['username'])){
  23. echo "already user exist";
  24. }{
  25. $this->db->insert('accounts',$data);
  26. redirect("painel/index");
  27. }
  28.  
  29. }
  30.  
  31. }
  32. $this->load->view("painel/register");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement