I am using an upload page for photos, and When I try to display the photo after it's been uploaded it only displays part of the photo. I realize that that is probably because the file is too big, but if anyone out there knows how to resize an image for display after its been uploaded I would really appreciate the help. This is the get.php page I'm using to display the image
<?php
$id=$_REQUEST['id'];
$image=mysql_query("SELECT*FROM demophotos WHERE id=$id");
$image=mysql_fetch_assoc($image);
$image=$image['image'];
header ("Content-type: image/jpeg");
echo $image;
?>
And this is the photo.php page that I'm using for uploading
<?php
$file= $_FILES['image'] ['tmp_name'];
if (!isset($file))
echo "Please select an image";
else
{
$image= addslashes(file_get_contents($_FILES['image'] ['tmp_name']));
$image_name= addslashes($_FILES['image'] ['name']);
$image_size= getimagesize($_FILES['image'] ['tmp_name']);
if ($image_size==FALSE)
echo "Well that's not an image now, is it?";
else
{
if(!$insert= mysql_query("INSERT INTO demophotos(id, name, image) VALUES ('', '$image_name', '$image')"))
echo "?";
else
{
$lastid=mysql_insert_id();
echo "Image uploaded <p /> You're Image: <p /><img src= get.php?id=$lastid>";
}
}
}
?>