Guest User

Untitled

a guest
Jan 24th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2. require('config.php');
  3.  
  4.  
  5. if (isset($_POST['email']))
  6. {
  7. $email = stripslashes($_REQUEST['email']);
  8.  
  9. $email = mysqli_real_escape_string($conn,$email);
  10. $password = stripslashes($_REQUEST['password']);
  11. $password = mysqli_real_escape_string($conn,$password);
  12.  
  13. $stmt = $conn->prepare("SELECT password FROM registo WHERE email=?");
  14. $stmt->bind_param("s",$email);
  15. $email = $_POST['email'];
  16. $stmt->execute();
  17. $result= $stmt->store_result();
  18.  
  19. if($stmt->affected_rows > 0)
  20. {
  21. $user = mysqli_stmt_bind_result($stmt, $pass);
  22. if(password_verify($password,$pass))
  23. {
  24. $_SESSION['email'] = $email;
  25. $_SESSION['user'] = true;
  26. header("Location: home.php");
  27.  
  28. <?php while($books =mysqli_stmt_fetch($stmt)){?>
  29. <?php $id = $id +1;?>
  30. <tr>
  31.  
  32. <td><?php echo '<img src="data:image/jpeg;base64,'.base64_encode( $books->Image).'"height="100" width="100">'; ?> </td> //linha 92
  33.  
  34. bool mysqli_stmt::fetch ( void ) // Método fetch do objeto stmt
  35. bool mysqli_stmt_fetch ( mysqli_stmt $stmt ) // Função mysqli_stmt_fetch
  36.  
  37. $books = mysqli_stmt_fetch($stmt)
  38.  
  39. SELECT password FROM registo WHERE email=?
  40.  
  41. if($stmt->affected_rows > 0)
  42. {
  43. // Associa o valor retornado na busca à variável $pass:
  44. $stmt->bind_result($pass);
  45.  
  46. // Enquanto houverem registros:
  47. while ($stmt->fetch())
  48. {
  49. // Exibe o valor retornado da consulta:
  50. echo $pass;
  51. }
  52. }
  53.  
  54. if($stmt->affected_rows > 0)
  55. {
  56. // Associa o valor retornado na busca à variável $pass:
  57. mysqli_stmt_fetch($stmt, $pass);
  58.  
  59. // Enquanto houverem registros:
  60. while (mysqli_stmt_fetch($stmt))
  61. {
  62. // Exibe o valor retornado da consulta:
  63. echo $pass;
  64. }
  65. }
  66.  
  67. if($stmt->affected_rows > 0)
  68. {
  69. $stmt->bind_result($id, $title, $author, $image, ...);
  70.  
  71. while ($stmt->fetch())
  72. {
  73. // Exibe os dados do livro:
  74. echo $id, $title, $author, $image, ...;
  75. }
  76. }
Add Comment
Please, Sign In to add comment