Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. try{
  2.  
  3. $this->has= crypt($password);
  4. $this->has_con= crypt($confirm_password);
  5. $p= "soy diferente de uno";
  6.  
  7. $registro=$this->conexion->conexion->query("insert into registro_por (nombre, correo, pass, conf_pass) values( '$username','$email','$this->has','$this->has_con')");
  8.  
  9. if($registro)
  10. {
  11. return $p;
  12.  
  13. }else{
  14. throw new Exception("Fallos la ejecución");
  15.  
  16. }
  17.  
  18.  
  19. }catch(Exception $e){
  20. echo 'Message: '.$e->getMessage();
  21.  
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28. }
  29.  
  30. $username =$_POST["username"];
  31. $email =$_POST["email"];
  32. $password =$_POST["password"];
  33. $confirm_password =$_POST["confirm_password"];
  34.  
  35.  
  36. $reg = new Registro();
  37. $t=$reg->registrar($username,$email,$password,$confirm_password);
  38.  
  39. var_dump($t);
  40.  
  41. if($t != 1){
  42. //return "ok";
  43. //echo "es difenrete de uno";
  44. return $t;
  45. }else{
  46. return $t;
  47. //echo "fail";
  48. }
  49.  
  50. var data= $('#register-form').serialize();
  51.  
  52. $.ajax({
  53. beforeSend:function(){
  54. console.log(data);
  55. },
  56. type:'POST',
  57. url:'../Controllers/registro.php',
  58. data:data,
  59. success: function(data){
  60. console.log('nanananana');
  61. console.log("soy data"+data);
  62. }
  63.  
  64. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement