j´ai ça qui traine chez moi...
$ip = getenv("REMOTE_ADDR");
/ / enleve les / / pour avoir l´host au lieu de l´IP
/ / $ip = gethostbyaddr($ip);
srand ( (double) microtime() * 13);
$font=2;
$largeur_compteur=strlen($ip);
$largeur_font=imagefontwidth($font);
$hauteur_font=imagefontheight($font);
$largeur_image=($largeur_compteur+2)*$largeur_font
;
$hauteur_image=$hauteur_font*2;
header ( "Content-type: image/png");
$image = @imagecreate ( $largeur_image, $hauteur_image) or die ( "Impossible d´initialiser la librairie GD");
$rgb=couleurs_aleatoire();
$r_fond=$rgb[0];
$g_fond=$rgb[1];
$b_fond=$rgb[2];
for ( $i=$hauteur_image;$i>=1;$i--)
{
$r_fond=$r_fond+((255-$rgb[0])/$hauteur_image);
$g_fond=$g_fond+((255-$rgb[1])/$hauteur_image);
$b_fond=$b_fond+((255-$rgb[2])/$hauteur_image);
$couleur[$i] =imagecolorallocate ( $image, $r_fond,$g_fond,$b_fond);
imageline($image,0,$i,$largeur_image,$i,$couleur[$
i]);
}
$background_color =imagecolorallocate ( $image, $rgb[0],$rgb[1],$rgb[2]);
$text_color = imagecolorallocate ( $image, 1,1,1);
imagerectangle ( $image,0,0,$largeur_image-1,$hauteur_image-1, $text_color);
imagestring ( $image, $font, $largeur_font, $hauteur_font/2, " $ip " , $text_color);
imagepng ( $image);
function couleurs_aleatoire()
{
$rgb[0]=rand(140, 254);
$rgb[1]=rand(140, 254);
$rgb[2]=rand(140, 254);
$rgb[3]=($rgb[0]-255)*(-1);
$rgb[4]=($rgb[1]-255)*(-1);
$rgb[5]=($rgb[2]-255)*(-1);
return $rgb;
}
:p