<?

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

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