HI, I have created a table, script to insert some small images, and during insert I 'addslashes'(insert works fine)... My php below has some problem when I try to stripslashes. Also, I receive an error regarding the header... any ideas??
On a .html page I type:
<IMG SRC="picturethumb.php">
On picturethumb.php I type:
<?
include("dBconnect.inc");
$id = 2;
$get_image = "SELECT filedata, mimetype FROM filestore WHERE filestore_id = $id";
$get_image_result = @mysql_query($get_image) or die("Couldn't get image.");
$binary_junk = @mysql_result($get_image_result,0,"filedata");
$binary_junk2 = stripslashes(fread(fopen($binary_junk, "r")));
$mimetype = @mysql_result($get_image_result,0,"mimetype");
header("Content-type: $mimetype");
echo "$binary_junk2";
?>