API: rating_icons

<?php
header('Access-Control-Allow-Origin: *');

if($_REQUEST['stars'])
{
	$rating = $_REQUEST['stars'];
	$rating = round($rating*2)*5;
	header("Content-type: image/jpeg");
	$im = imagecreatefromjpeg("stars/$rating.jpg");
	imagejpeg($im);
	imagedestroy($im);
}
else if($_REQUEST['dollars'])
{
	$rating = $_REQUEST['dollars'];
	if($rating<0) $rating = 0;
	if($rating > 4) $rating = 4;

	$rating = round($rating);
	header("Content-type: image/jpeg");
	$im = imagecreatefromjpeg("dollars/$rating.jpg");
	imagejpeg($im);
	imagedestroy($im);
}
?>