<?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();
?>
我收到「圖片」圖片鏈接「無法顯示,因爲它包含錯誤」。我已經嘗試將內容標題位置更改爲各個地方,並且無法使其正常工作。我已經從數據庫直接下載了圖像,並且它能夠正確複製。當用鉻合金打開頁面時,我會看到一張很小的綠色圖片。無法顯示圖片「[blah]」,因爲它包含錯誤
嘗試刪除最後一個'?>'?也許你的文件最後包含空格。 – 2013-04-20 21:26:00
@EduardLuca感謝您的輸入,但沒有骰子:( – user2302779 2013-04-20 21:46:22