This is my getImage.php page for php code
<?php
if(isset($_GET['email'])){
$con = mysqli_connect("localhost", "root", "") or die(mysqli_error($con));
mysqli_select_db($con,"ajmal") or die(mysqli_error($con));
$sql = mysqli_query($con,"SELECT image FROM users WHERE email='$email'");
while ($row = mysqli_fetch_array($sql)) {
$imageData = $row["image"];
}
header("Content-type: image/jpeg");
echo $imageData;
}
else{
echo "Error";
}
?>
and this is my img tag where i use getImage.php page
<img src="getImage.php?email = $email" width="100" height="100">
and this is the output
what is the problem with it and what is its solution?