<?php
ob_start();
session_start();
require_once('name.php');
if(!isset($_GET['e']))
{
header('HTTP/1.1 204 No Content');
exit();
}
if(empty($_SESSION['id']))
{
header('Location: login.php');
exit();
}
$id=$_GET['e'];
//database login information removed
$statement2=$db->prepare('select * from event2 where id=:id and userid=:uid');
$statement2->execute(array('id' => $id,
'uid' => $_SESSION['id']));
if($statement2->rowCount()==0)
{
header('HTTP/1.1 204 No Content');
exit();
}
$row=$statement2->fetch();
$image=$row['image'];
$realimage=imagecreatefromstring($image);
header('Content-type: image/jpeg');
$realimage;
ob_end_flush();
?>
I'm receiving an "Image 'image link' cannot be displayed because it contains errors." I've tried changing the content header position around to various places and cannot get it to work. I've downloaded the image straight from the database and it does reproduce properly. When opening the page in chrome, I'm presented with a tiny little green stock picture.