I am trying to display and image from a special get.php file. The whole purpose of this file is to display the image as though the enitre file was an image itself. It would be thought of as a changing immage depending on how you call the file. So if i called get.php?id=1. I would get the first image in the database. For the purposes of this example assume sercurity is not a consern for me. Here is the code.
[php]
<?php mysql_connect("localhost","champion_0369","hotmail0369") or die(mysql_error()); mysql_select_db("champion_vehicles") or die(mysql_error()); $id = addslashes($_REQUEST['id']); $image = mysql_query("SELECT `id`, `file_name`, `image` FROM `images` WHERE id=$id"); $image = mysql_fetch_assoc($image); $image = $image['image']; //$imagetype = 'jpeg'; header('Content-type: image/jpeg'); echo $image; ?>[/php]