xstream: img-Tag und php-Datei benutzen

Beitrag lesen

bei mir geht es ohne probleme...:
<?php
include('../config.php');
mysql_connect($dbhost,$dbuser,$dbpasswd);
mysql_select_db($dbname);
$sql="SELECT * FROM webring WHERE id='$_GET[id]'";
$counter=mysql_result(mysql_query($sql),0,'counter');
@$counter=$counter/1000;
$counter=$counter*10;
$counter=round($counter);
$img="ranks/$counter.gif";
if ($counter>10) {
$img="ranks/10.gif";
}
header('Location: '.$img.'');
error_reporting (E_PARSE);
header("Content-type: image/jpeg");
header("Content-Disposition: attachment; filename=$counter.gif");
header("Content-Length: " . filesize(getcwd() . "$img"));
readfile(getcwd() . "$img");
?>

mach mal no das hinein: vor error_:
header('Location: '.$img.'');