I have a problem with a dynamic image not showing up when uploaded to my remote server. This is the script:
CODE
<?php
// Header-Informationen einstellen
Header ('Content-type: image/png');
Header ('Cache-Control: must-revalidate, no-cache, no-store, post-check=0, pre-check=0');
Header ('Pragma: no-cache');
// Bildgre einstellen
$img_width = 521;
$img_height = 50;
// Bild erstellen
$image = imagecreate($img_width, $img_height);
// Farben einstellen
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 128, 220, 0);
// Hintergrund-Farbe und Rnder einstellen
imagefilledrectangle($image, 0, 0, $img_width, $img_height, $white);
imageline($image, 0, 0, 0, $img_height, $black); // Rand links
imageline($image, 0, 0, $img_width, 0, $black); // Rand oben
imageline($image, 0, $img_height - 1, $img_width, $img_height - 1, $black); // Rand unten
imageline($image, $img_width - 1, 0, $img_width - 1, $img_height - 1, $black); // Rand rechts
// Liedinformationen aus Textdatei extrahieren
$song_info = file("http://maresweb.homeip.net/foobar2000.txt");
// Schriftart einstellen
$font = 'cour.ttf';
// Text und Fortschrittsanzeige drucken
if(empty($song_info[0])) {
ImageTTFText ($image, 9, 0, 10, 19, $black, $font, 'Ich hre gerade keine Musik.');
imagefilledrectangle($image, 10, 30, 10, 40, $grey);
}
else {
ImageTTFText ($image, 9, 0, 10, 19, $black, $font, $song_info[0]);
imagefilledrectangle($image, 10, 30, $song_info[1] + 10, 40, $grey);
}
imageline($image, 10, 30, 10, 40, $black); // Rand links
imageline($image, 10, 30, 510, 30, $black); // Rand oben
imageline($image, 10, 40, 510, 40, $black); // Rand unten
imageline($image, 510, 30, 510, 40, $black); // Rand rechts
// Bild ausgeben und Speicher befreien
imagepng($image);
imagedestroy($image);
?>
The .htaccess file looks like this:
CODE
<Files playing.png>
ForceType application/x-httpd-php
</Files>
ForceType application/x-httpd-php
</Files>
When the image is placed on my local server, everything works fine, but when calling it from the remote server, I get "The image "http://school.maresweb.de/playing.png" cannot be displayed, because it contains errors.". Any idea what might be causing this? IE displays the following:
QUOTE
Warning: file(http://maresweb.homeip.net/foobar2000.txt) [function.file]: failed to open stream: HTTP request failed! HTTP/1.1 304 Not Modified in /www/htdocs/sebmar/playing.png on line 30
PNG IHDR 2$nU$PLTÈ???___v9xIDATx1o1Աo8}xdx墨 R1$m]wT( Jb?a# Xb Xb @NxmGm9dZ ɨ@PM!ytql kz:L:LߖDjsHzw5Tf"&t 2`r-KW8SQe|KA`ap.*{d| OWδEsRn7xgi{X0x6Mbk se殤.1 , -OjTo-Ng/, nx/d55]c/ ַ4"*Il,j_߈YN#Co4(P)Rϊ33Lcj}wbTg5Zh
k})}wgG _B"'h Xb XbZq<z! @, @,B Op-s @, @,؇wrS;hnIENDB`
PNG IHDR 2$nU$PLTÈ???___v9xIDATx1o1Աo8}xdx墨 R1$m]wT( Jb?a# Xb Xb @NxmGm9dZ ɨ@PM!ytql kz:L:LߖDjsHzw5Tf"&t 2`r-KW8SQe|KA`ap.*{d| OWδEsRn7xgi{X0x6Mbk se殤.1 , -OjTo-Ng/, nx/d55]c/ ַ4"*Il,j_߈YN#Co4(P)Rϊ33Lcj}wbTg5Zh
k})}wgG _B"'h Xb XbZq<z! @, @,B Op-s @, @,؇wrS;hnIENDB`
