Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
119
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. ?>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement