View difference between Paste ID: ZU5tuW6u and cKttkRda
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
if (empty($_GET['id'])) {
4
	header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1') . ' 404', TRUE, 404);
5
	exit;
6
}
7
8
ob_start();
9
include('site_config.php');
10
ob_end_clean();
11
12
$id = mysql_real_escape_string($_GET['id']);
13
$result = mysql_query("SELECT image FROM frontpage_auto_slideshow WHERE id = '{$id}';");
14
if (mysql_num_rows($result) > 0) {
15
	$row = mysql_fetch_assoc($result);
16
	header('Content-Type: ' . Nette\Utils\MimeTypeDetector::fromString($row['image'])); 
17
	echo $row['image'];
18
}