Der Fehler liegt darin, daß im IE das Spambild nicht neu geladen wird. Erzeugt wird dies mit PHP und funktioniert auch, nur wird es halt nicht neu geladen?
Hiermit erzeuge ich das Bild, der Text wird in $dataS abgelegt.
<?php
// header ("Content-type: image/gif");
$t=time()*1000;
mt_srand($t);
$_SESSION['random']=mt_rand(111111,999999);
// die zufalsszahl holen
$dataS=$_SESSION['random'];
//erzeugen eines bildes in den abmessungen 60 x 20 px
$im = ImageCreate (60, 22)
or die ($dataS);
// die hintergrundfarbe bestimmen
$background_color = ImageColorAllocate ($im, 180, 180, 180);
// die pixelfarbe bestimmen, mit der auf dem bild 'gemalt' wird
$colorPix = ImageColorAllocate ($im, 200, 200, 200);
// ein pixelraster über das bild legen
$y=3;
WHILE($y<20){
$x=3;
WHILE($x<60){
imagesetpixel($im, $x, $y, $colorPix);
$x=$x+3;
}
$y=$y+3;
}
// eine neue pixelfarbe bstimmen
$colorPix = ImageColorAllocate ($im, 180, 180, 180);
// ein weiteres pixelraster über das bild legen
$y=2;
WHILE($y<20){
$x=2;
WHILE($x<60){
imagesetpixel($im, $x, $y, $colorPix);
$x=$x+3;
}
$y=$y+3;
}
// die textfarbe bestimmen
$text_color = ImageColorAllocate ($im, 235, 235, 235);
//$text_color = ImageColorAllocate ($im, 0, 0, 0);
// die zufallszahl auf das bild schreiben
ImageString ($im, 5, 3, 3,rtrim($dataS), $text_color);
// eine neue pixelfarbe bestimmen
$colorPix = ImageColorAllocate ($im, 160, 160, 160);
// ein weiteres raster über das bild mit der schrift legen
$y=1;
WHILE($y<20){
$x=1;
WHILE($x<60){
imagesetpixel($im, $x, $y, $colorPix);
$x=$x+3;
}
$y=$y+3;
}
// das bild ausgeben
Imagepng($im,"bilder/kspam.png");
?>
Alles anzeigen
Und so stelle ich es dan dar
<?php
include ("kontakt_bild.php");
$fp_sp = fopen($kt_spdatei,"w");
flock($fp_sp,LOCK_EX);
fputs($fp_sp,$dataS);
flock($fp_sp,LOCK_UN);
fclose($fp_sp);
echo " <p align=\"center\"><span class=\"gbuchformularfehler\">$dataS</span></p>\r\n";
?>
<img src="bilder/kspam.png" width="60" height="22" border="0" alt="Counter">
Alles anzeigen