Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('config.php');
- if (isset($_POST['email']))
- {
- $email = stripslashes($_REQUEST['email']);
- $email = mysqli_real_escape_string($conn,$email);
- $password = stripslashes($_REQUEST['password']);
- $password = mysqli_real_escape_string($conn,$password);
- $stmt = $conn->prepare("SELECT password FROM registo WHERE email=?");
- $stmt->bind_param("s",$email);
- $email = $_POST['email'];
- $stmt->execute();
- $result= $stmt->store_result();
- if($stmt->affected_rows > 0)
- {
- $user = mysqli_stmt_bind_result($stmt, $pass);
- if(password_verify($password,$pass))
- {
- $_SESSION['email'] = $email;
- $_SESSION['user'] = true;
- header("Location: home.php");
- <?php while($books =mysqli_stmt_fetch($stmt)){?>
- <?php $id = $id +1;?>
- <tr>
- <td><?php echo '<img src="data:image/jpeg;base64,'.base64_encode( $books->Image).'"height="100" width="100">'; ?> </td> //linha 92
- bool mysqli_stmt::fetch ( void ) // Método fetch do objeto stmt
- bool mysqli_stmt_fetch ( mysqli_stmt $stmt ) // Função mysqli_stmt_fetch
- $books = mysqli_stmt_fetch($stmt)
- SELECT password FROM registo WHERE email=?
- if($stmt->affected_rows > 0)
- {
- // Associa o valor retornado na busca à variável $pass:
- $stmt->bind_result($pass);
- // Enquanto houverem registros:
- while ($stmt->fetch())
- {
- // Exibe o valor retornado da consulta:
- echo $pass;
- }
- }
- if($stmt->affected_rows > 0)
- {
- // Associa o valor retornado na busca à variável $pass:
- mysqli_stmt_fetch($stmt, $pass);
- // Enquanto houverem registros:
- while (mysqli_stmt_fetch($stmt))
- {
- // Exibe o valor retornado da consulta:
- echo $pass;
- }
- }
- if($stmt->affected_rows > 0)
- {
- $stmt->bind_result($id, $title, $author, $image, ...);
- while ($stmt->fetch())
- {
- // Exibe os dados do livro:
- echo $id, $title, $author, $image, ...;
- }
- }
Add Comment
Please, Sign In to add comment