I am trying to display an image, but my webpage displays encoding stuff instead. Below is my code:
<?php ob_start();?>
// html markups goes here
<?php include 'login.php';
if(isset($_GET['productid'])){
$productid = $_GET['productid'];
$sql = "select tyre_image from tyres where product_id = '$productid'";
$result = mysql_query($sql) or die(mysql_error());
header("Content-type :image/jpg");
echo mysql_result($result,0);
}
ob_end_flush();
?>
I am using $_GET associative array($_GET['variable']) to get the product ID via a link on another page.
How would I fix this?