I'm tying in to vB's user system for a site I'm working on and I'd like to display user avatars throughout the site on lots of non-vb pages. I'm having trouble getting the images to display though.
Here's the query I'm making in my avatar.php file that should display a user avatar:
PHP Code:
$sql = mysql_query("SELECT filedata, dateline, filename
FROM vb_customavatar
WHERE userid = '1'");
$row=mysql_fetch_array($sql);
header("Content-Length: ".strlen($row[filedata]));
header('Content-transfer-encoding: binary');
header("Content-Disposition: inline; filename=\"".$row['filename']."\";");
header("Content-Type: image/jpeg");
echo $row['filedata'];
The query works fine, but it's just plain not showing the image.
Am I missing something?