Little Goat wrote:
$im = @imagecreatefromstring(file_get_contents('image.jpg'));
header ("Content-type: image/jpg");
You have the order a bit wrong; the header needs to be sent before the image:
header ('Content-Type: image/jpg');
But all this is pretty pointless apart from being a learning exercise because nothing is actually being done with the image itself.