I'm developing a php site right now. I was making the login page and when i checked if the login code works, it printed the whole prepare line.
output:
prepare("select * from login_details where user = ? && pass= ?;");
$stmt>bindValue(1, $name); $stmt->bindValue(2, $pass); $stmt->execute;
$row = $stmt->fetchall(PDO::FETCH_ASSOC); while ($row) { echo "
Failed
"; } ?
and my code was,
<body>
<?php
include 'connect.php';
if(isset($_POST['username']) && isset($_POST['pass'])){
$name=htmlentities($_POST['username']);
$pass=htmlentities($_POST['pass']);
}
$stmt= $dbh->prepare("select * from login_details where user = ? && pass= ?;");
$stmt->bindValue(1, $name);
$stmt->bindValue(2, $pass);
$stmt->execute;
$row = $stmt->fetchall(PDO::FETCH_ASSOC);
while ($row) {
echo "<h2>Failed</h2>";
}
?></body>