Advertisement
corovino

Untitled

Feb 6th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. //----------------------------------Model
  2.  
  3. public function registrar($username,$email,$password,$confirm_password)
  4. {
  5. $this->has= crypt($password);
  6. $this->has_con= crypt($confirm_password);
  7. $p="ok";
  8. $registro=$this->conexion->conexion->query("insert into registro_por (nombre, correo, pass, conf_pass) values( '$username','$email','$this->has','$this->has_con')");
  9.  
  10. try{
  11.  
  12.  
  13.  
  14. if($registro)
  15. {
  16. return $p;
  17. }else{
  18. throw new Exception("Fallos la ejecución");
  19. return false;
  20. }
  21.  
  22.  
  23.  
  24. }catch(Exception $e){
  25.  
  26. echo 'Message: '.$e->getMessage();
  27.  
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement