Advertisement
Guest User

Untitled

a guest
Sep 7th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. header('Content-Type: image/x-png'); //or whatever
  3. readfile('23456.png');
  4. die();
  5. ?>
  6.  
  7. <?php
  8. $servername = "localhost";
  9. $username = "db_local";
  10. $password = "123456";
  11. $dbname = "prueba";
  12.  
  13. $method = $_SERVER['REQUEST_METHOD'];
  14. $request = explode('/', trim($_SERVER['PATH_INFO'],'/'));
  15. $input = json_decode(file_get_contents('php://input'),true);
  16.  
  17. $usuario = array_shift($request);
  18. $clave = array_shift($request);
  19.  
  20. $conn = new mysqli($servername, $username, $password, $dbname);
  21.  
  22. if ($conn->connect_error) {
  23. echo "La conexion no ha sido posible";
  24. }
  25.  
  26. $sql = "SELECT V.* FROM `VAR_GLOBAL` V INNER JOIN CLIENTES C ON C.NCliente LIKE '$usuario' AND C.Nombre LIKE '$clave';";
  27.  
  28. $result = mysqli_query($conn, $sql);
  29.  
  30. if (mysqli_num_rows($result) > 0) {
  31.  
  32. while($row = mysqli_fetch_assoc($result)) {
  33.  
  34. echo $row['EncPwd'] . "|" . $row['EncPwd2'];
  35. }
  36. } else {
  37. echo "No hay resultados";
  38. }
  39. mysqli_close($conn);
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement