I am having trouble with displaying an image from a url. In the following code if I echo out $test I get the url of the image. However, in the current code I am trying to display the image, but the only thing that gets displayed is a small broken image in the upper left.
$html = file_get_contents($website.$criteria);
$dom = new DOMDocument;
@$dom->loadHTML($html);
$links = $dom->getElementsByTagName('img');
header('Content-Type: image/png');
foreach ($links as $link){
$test = $link->getAttribute('src');
echo file_get_contents($test);
}
image that gets displayed: http://imgur.com/epfF3wJ