camera.php 516 Bytes
Newer Older
mpomery's avatar
mpomery committed
1
<?php
mpomery's avatar
mpomery committed
2
3
	$camera = 'nocamera';
	if (isset($_GET['camera']))
Mitchell Pomery's avatar
Mitchell Pomery committed
4
5
		$camera=$_GET['camera'];
	$imagelocation="../../";
mpomery's avatar
mpomery committed
6
	$file = $imagelocation.strtolower($camera).".jpg";
Mitchell Pomery's avatar
Mitchell Pomery committed
7
	//echo $file;
mpomery's avatar
mpomery committed
8
	header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");
Mitchell Pomery's avatar
Mitchell Pomery committed
9
	if (!is_readable($file)) {
mpomery's avatar
mpomery committed
10
		$file="nocamera.jpg";
Mitchell Pomery's avatar
Mitchell Pomery committed
11
	}
mpomery's avatar
mpomery committed
12
13
14
15
16
17
18
	header("Content-Type: image/jpeg");
	header("Content-Length: ".filesize($file));
	header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($file))." GMT");
	$fp = fopen($file, 'rb');
	fpassthru($fp);
	fclose($fp);
?>