SHARE
TWEET

Untitled

a guest Jun 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <?php
  3. include "db/conexionDB.php";
  4.  
  5. $response = array();
  6. if(isset($_POST['correo']) || isset($_POST['clave'])){
  7.     $correo = $_POST['correo'];
  8.     $clave = $_POST['clave'];
  9.     $stmt = $con->prepare("SELECT correo, clave FROM usuarios WHERE correo = ? AND clave = ?");
  10.  
  11.     $stmt->bind_param("ss",$correo,$clave);
  12.     $stmt->execute();
  13.     $stmt->bind_result($idusuario,$correo);
  14.     $stmt->fetch();
  15.     if($_POST["correo"] == $correo && $_POST["clave"] == $clave){
  16.         $response['error'] = false;
  17.         $response['message'] = "Login Successful!";
  18.         $response['correo'] = $correo;
  19.         $response['idusuario'] = $idusuario;
  20.     } else{
  21.         $response['error'] = false;
  22.         $response['message'] = "Invalid Email or Password";
  23.     }
  24. } else {
  25.     $response['error'] = true;
  26.     $response['message'] = "Insufficient Parameters";
  27. }
  28. echo json_encode($response);
  29. var_dump($_POST);
  30. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top