Mailinglisten-Archive |
Hallo Programmierer,
Ich mache gerade die ersten Erfahrungen mit PHP unter Windows und habe 2
Probleme!
1.) Die globale Systemvariable -> $_SERVER['DOCUMENT_ROOT'] gibt es nicht!
2.) Das Authorizierungs Bild mit einem Code lässt sich unter Windows nicht
mehr erstellen.
function createSecurityCodeImage($id="")
{
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
header ("Content-type: image/png");
$s = htmlspecialchars($id);
$font = 4;
$width = ImageFontWidth($font) * strlen($s);
$height = ImageFontHeight($font);
$im = @imagecreate($width,$height);
$background_color = imagecolorallocate ($im, 255, 255, 255); //white
background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, 0, 0, $s, $text_color);
imagepng ($im);
ImageDestroy ($im);
}
Für Tipps und Tricks betreffend Windows Unterschiede wäre ich sehr dankbar.
Ivan
php::bar PHP Wiki - Listenarchive