从其他站点提供图像时出错

Basically what I want to do is have a section on my site, where you provide the username of a user, example: NOTCH

Where it then goes to the minecraft host and finds the user's skin. "Skin Stealer" if you like.

However I'm getting an error and have no idea how to get around it..

<?php
if ($_GET['user'])
{
$user = $_GET['user'];

if(trim($user) == '')
{
    die('No username entered!');
}

$user = preg_replace('/\s+/', '', $user);

header('Content-Type: image/png');
$picture = '<img src="http://s3.amazonaws.com/MinecraftSkins/$user.png">';
$getpicture = file_get_contents("$picture");
echo $picture
}
?>

The HTML is just a basic form which reads the php page called 'mcskin.php'

If using file_get_contens you just need the url:

$picture = "http://s3.amazonaws.com/MinecraftSkins/$user.png";

Also change

$getpicture = file_get_contents("$picture");

to

$getpicture = file_get_contents($picture);

You don't use the right quotes:

$picture = "<img src='http://s3.amazonaws.com/MinecraftSkins/$user.png'>";

And in this line quotes are not needed:

$getpicture = file_get_contents($picture);

Also you are aplying file_get_contents() to the img tag which make no sense. Pass it the URL:

$pictureUrl = "http://s3.amazonaws.com/MinecraftSkins/$user.png";
$getpicture = file_get_contents($pictureUrl);