PDA

View Full Version : retrieve info from php link


Keiichi
05-10-2001, 11:34 PM
you know on boards like vbulletin where the user can put an avatar. and when you look at the image properties or in the source, the image src is link to a php script ( src="avatar.php?id=blah). this can be useful in hiding the actual image source (mostly if it was linked from another server).

if tried making a script like that but it doesn't work (it doesn't return the value)
does anyone know how to do this?
thanks

trafficg
05-12-2001, 02:20 PM
In the example below the image is stored in a database, if the image is stored on the hard drive you will have to open and read the file first.

[nbsp][nbsp][nbsp][nbsp]

<?
$id = isset($id) ? $id : &quot;&quot;;

$sql=&quot;SELECT pic FROM avatar_db WHERE id = '$id'&quot;;
$rs=mysql_query($sql,$con);
if($row=mysql_fetch_array($rs))
{
Header( &quot;Content-type:[nbsp][nbsp]image/gif&quot;);
echo $row[&quot;pic&quot;];
}
?>



Note:

The script should not produce any output other than from the echo statement.

Pete Kelly
Free Traffic and Website Promotion!
www.TrafficG.com (http://www.TrafficG.com)

Keiichi
05-12-2001, 04:37 PM
thanks, i'll try it later and see what happens :)