Signatur mag micht angezeigt werden

hi habe den code hier im forum gefunden aber der zeigt mir immer an “Die Grafik “http:” kann nicht angezeigt werden, weil sie Fehler enthält”

hier mal der code:

[code]<?php
header(“Content-type: image/png”); // Für eine PNG Datei
//header(“Content-type: image/jpeg”); // Für eine JPG Datei
//header(“Content-type: image/gif”); //Für eine Gif Datei
$img = imagecreatefrompng(“sig.png”); //sollte das Pic in einem Unterordner liegen müsst Ihr diesen mit angeben zB. /img/deine_Datei.png
$white = imagecolorallocate($img,255,255,255);
$black = imagecolorallocate($img,0,0,0);
$red = imagecolorallocate($img,255,0,0);
$blue = imagecolorallocate($img,0,0,255);
// Auslesen der Browser
if (ereg( ‘MSIE’,$_SERVER[HTTP_USER_AGENT])) {
if (strstr($_SERVER[HTTP_USER_AGENT],‘MSIE 5.0’)) {
$browser = “Internet Explorer 5”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT],‘MSIE 5.5’)) {
$browser = “Internet Explorer 5.5”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT],‘MSIE 6.0’)) {
$browser = “Internet Explorer 6”;
} else {
$browser = “Internet Explorer”;
}
} elseif (ereg( ‘Opera’,$_SERVER[HTTP_USER_AGENT])) {
$browser = “Opera”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Firefox”)) {
$browser = “Firefox”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Safari”)) {
$browser = “Safari”;
} elseif (ereg(“Lynx”, $_SERVER[“HTTP_USER_AGENT”])) {
$browser = “Lynx”;
} elseif(ereg(“WebTV”, $_SERVER[“HTTP_USER_AGENT”])) {
$browser = “WebTV”;
} elseif(ereg(“Konqueror”, $_SERVER[“HTTP_USER_AGENT”])) {
$browser = “Konqueror”;
} elseif (ereg( ‘Mozilla/([0-9].[0-9]{1,2})’,$_SERVER[HTTP_USER_AGENT])) {
$browser = “Mozilla”;
} else {
$browser = “Unknown”;
}
// Auslesen der Betriebssysteme
if (strstr($_SERVER[HTTP_USER_AGENT], “Windows 95”)) {
$os = “Windows 95”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Windows 98”)) {
$os = “Windows 98”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “NT 4.0”)) {
$os = “Windows NT”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “NT 5.0”)) {
$os = “Windows 2000”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “NT 5.1”)) {
$os = “Windows XP”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Win”)) {
$os = “Windows”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Mac”)) {
$os = “MacOS”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Linux”)) {
$os = “Linux”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “FreeBSD”)) {
$os = “FreeBSD”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “SunOS”)) {
$os = “SunOS”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “IRIX”)) {
$os = “IRIX”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “BeOS”)) {
$os = “BeOS”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “OS/2”)) {
$os = “OS/2”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “AIX”)) {
$os = “AIX”;
} elseif (strstr($_SERVER[HTTP_USER_AGENT], “Unix”)) {
$os = “Unix”;
} else {
$os = “Unbekanntes System”;
}
// IP bestimmen und Host auslesen
$ip = getenv(“REMOTE_ADDR”);
$host = gethostbyaddr($ip);

imagettftext($img, 12, 0, 120, 45, $black, “fonts/Quirkus.ttf”, "Dein OS ist: ");
imagettftext($img, 12, 0, 200, 45, $red, “fonts/Quirkus.ttf”, “”. $os);

imagettftext($img, 12, 0, 120, 60, $black, “fonts/Quirkus.ttf”, "Dein Browser ist: ");
imagettftext($img, 12, 0, 230, 60, $blue, “fonts/Quirkus.ttf”, “”. $browser);

imagettftext($img, 12, 0, 120, 75, $black, “fonts/Quirkus.ttf”, "deine IP-Adresse: ");
imagettftext($img, 12, 0, 230, 75, $red, “fonts/Quirkus.ttf”, “”. $ip);

imagettftext($img, 12, 0, 120, 90, $black, “fonts/Quirkus.ttf”, "dein Host ist: ");
imagettftext($img, 12, 0, 120, 105, $blue, “fonts/Quirkus.ttf”, “”. $host);

imagepng($img);
?>[/code]

bild und die schriftart datei sind im gleich verzeichnes…

Kommentiere den header-Aufruf aus, und rufe das Script direkt über die Adresszeile in deinem Browser auf - dann siehst du eine Reihe von Fehlermeldungen.

aha… und wie hilf mir das?

Es hilft PHP dir zu helfen. Versuche diese Fehlermeldungen zu deuten. Wenn du nicht weiter weißt, poste sie hier. Aber mach dir bitte zuerst selbst Gedanken.

Und die Fehlerausgabe:

<style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagecreatefrompng() [<a href='http://de.php.net/function.imagecreatefrompng'>function.imagecreatefrompng</a>]: 'sig.png' is not a valid PNG file in <b>/users/steive1/www/sig/signa.php</b> on line <b>3</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagecolorallocate() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>4</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagecolorallocate() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>5</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagecolorallocate() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>6</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagecolorallocate() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>7</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>74</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>75</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>77</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>78</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>80</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>81</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>83</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>84</b><br /> </span><style>.bpe a:link, .bpe a:visited, .bpe a:active { color: #0b4c8e; text-decoration: none; } .bpe a:hover { color: #0D7CEC; }</style> <span class="bpe" style="font: 11px/1.2em Verdana, sans-serif;"><br /> <b>Warning</b>: imagepng() expects parameter 1 to be resource, boolean given in <b>/users/steive1/www/sig/signa.php</b> on line <b>86</b><br /> </span>
Das wichtigste dabei ist, das sig.png nicht als Bild erkannt wird,

Dann sagt dir PHP, was du falsch machst.

Und dann kannst du anfangen, die Fehler auszubessern.

aha… ähhm ich habe keine ahnung was ich falsch mache… kann auch die fehler meldung nicht danz deuten… was ist denn da falsch?

Was gibt es denn daran nicht zu verstehen?

Unter dem Dateinamen ‘sig.png’, den du im Script angegeben hast, ist kein gültiges PNG-Bild vorhanden.

is egal… habe schon alle fehler gefunden…