<?

header("Cache-Control: no-cache");
require("inc.php");
$link = connect_db();

$select = @mysql_query ("Select myavatar,user from users where id='".$usid."'"); 
$inf = mysql_fetch_array ($select);
$img = $inf["myavatar"];
$user = $inf["user"];
$ras=explode(".", $img);
$type=$ras[1];
 
if(strtolower($type)=="jpg")
{
header("Content-type: image/jpeg");
readfile("loadavatars/$usid.jpg");
}
elseif(strtolower($type)=="gif")
{
header("Content-type: image/gif");
readfile("loadavatars/$usid.gif");
}
else
{
header("Content-type: image/png");
readfile("loadavatars/$usid.png");
}
mysql_close($link); 
?>