There is also code for PHP to display IP signature pictures.
The code is as follows:
& lt? Header ("content-type: image/png");
//Note that none of the following content supports Chinese unless you write it in utf-8.
if(getenv(" HTTP _ CLIENT _ IP "){
$ IP = getenv(" HTTP _ CLIENT _ IP ");
$ip_agent = getenv ("remote _ addr");
} else if(getenv(" HTTP _ X _ FORWARDED _ FOR "){
$ IP _ real = getenv(" HTTP _ X _ FORWARDED _ FOR ");
$ip_agent = getenv ("remote _ addr");
} Otherwise {
$ip_real = getenv ("remote _ addr");
$ ip _ agent =
}
//The above is the real IP of the extracted browser.
$ User = getenv(" HTTP _ User _ AGENT ");
if(eregi("Windows[[:space:]]98 ",$User)) {
$ User _ Agent = " Windows 98
}
else if(eregi(" Win[[:space:]]9x[[:space:]]4.90 ",$User)) {
$ User _ Agent = " Windows ME
}
else if(eregi(" Windows[[:space:]]NT[[:space:]]5.0 ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Windows 2000
}
else if(eregi(" Windows[[:space:]]NT[[:space:]]5. 1 ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Windows XP
}
else if(eregi(" Windows[[:space:]]NT[[:space:]]5.2 ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Windows 2003
}
else if(eregi(" Windows[[:space:]]NT ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Windows NT
}
elseif (eregi("unix ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Unix
}
elseif (eregi("Linux ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " Linux
}
elseif (eregi("SunOS ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " SunOS
}
elseif (eregi("BSD ",getenv(" HTTP _ USER _ AGENT ")){
$ User _ Agent = " BSD
}
Otherwise {
$ User _ Agent = " Other
}
//The above is the information about the operating system of the browser.
if (eregi("MSIE[[:space:]]6 ",getenv(" HTTP _ USER _ AGENT ")){
$ClientInfo = "Microsoft IE 6.0 ";;
}
elseif (eregi("MSIE[[:space:]]5 ",getenv(" HTTP _ USER _ AGENT ")){
$ClientInfo = "Microsoft IE 5.0 ";;
}
elseif (eregi("MSIE[[:space:]]4 ",getenv(" HTTP _ USER _ AGENT ")){
$ClientInfo = "Microsoft IE 4.0 ";;
}
elseif (eregi("Netscape ",getenv(" HTTP _ USER _ AGENT ")){
$ ClientInfo = " Netscape
}
elseif (eregi("Opera ",getenv(" HTTP _ USER _ AGENT ")){
$ ClientInfo = " Opera
}
Otherwise {
$ ClientInfo = " Other
}
//The above is the IE information of the browser.
$ time = date(" Y-m-d H:I ");
//The above is the time to get the system. If you want to add a second, write it as Y-m-d H:i:s, you know English, and you will know what is going on at a glance.
$top = "Your information:";
//top text
$ line = "-";
$ info = " Power:SBKCSTUDIO ";
$WebInfo = "SBKC。 CHXN . COM ";
//The above two are copyright information. You can change them at will. I don't mind.
If (! $ip_agent){
$ Wen Zi = "IP:";
$ IP _ count = strlen($ IP _ real);
$ left = 22
$ width = 105;
//Image width
$ height = 100;
//Image height
$picture=Imagecreate($width,$ height);
$ bgcolor = imagecolorlallocate($ picture,225,250,225);
//Background color, the first 225 represents red, 250 represents green, and 225 represents yellow [tricolor principle]. Together, they can match a color. This can be adjusted by itself, ranging from 0 to 255.
$ border color = imagecolorlallocate($ picture,0,0,0);
//border color, the principle is the same as above
$ f($ picture, 0,0,0);
//The first font color
$ font color 2 = imagecolorlallocate($ picture, 100,0,255);
//Second font color
$ fontcolor3 = imagecolordocument ($ picture, 255, 100,100);
//The third font color
$ orig img = ImageCreateFromPNG(" test . png ");
//The background image must be in png format.
imagecopyrefized($ picture,$origImg,0,0,0,$width,$height,ImageSX($origImg),ImageSY($ origImg));
//Combine the background image and the original image into code.
Imageline($picture,0,0,$width- 1,0,$ border color);
Imageline($picture,0,0,0,$height- 1,$ border color);
Imageline($ picture, $width- 1, $height- 1, $width- 1, 0, $ bordercolor);
Imageline($ picture, $width- 1, $height- 1, 0, $height- 1, $ bordercolor);
//The above is the border setting.
Imagestring($picture,2,2,0,$top,$ font color 3);
Imagestring($picture,2,2, 10,$line,$ font color);
Image string($ picture, 2,2,20, $ Wen Zi, $ font color);
Imagestring($picture,2,$left+2,20,$ip_real,$ font color);
Imagestring($picture,2, 14,32,$User_Agent,$ font color);
Imagestring($picture,2,4,44,$ClientInfo,$ font color);
Imagestring($picture,2,4,54,$time,$ font color);
Imagestring($picture,2,2,62,$line,$ font color);
Imagestring($picture,2,2,72,$info,$ font color 2);
Imagestring($picture,2, 14,84,$WebInfo,$ font color 2);
//The above is to write text information into the picture, where three numbers mean: the first is the font size, the second is the distance from the left side of the picture, and the third is the distance from the top.
Imagepng($ picture);
//Synthetic image
Image destroy($ picture);
//Destroy the image stream to free up memory.
}
//The above is the code when obtaining a single IP.
Otherwise {
$ wenzi 1 = " IP 1:";
$ wenzi 2 = " IP2:";
$ IP _ count 1 = strlen($ IP _ real);
$ IP _ count 2 = strlen($ IP _ agent);
$ left = 26
if($ IP _ count 1 & gt; = $ IP _ count 2){ $ width = $ IP _ count 1 * 6+$ left+5; } else { $ width = $ IP _ count 2 * 6+$ left+5; }
$ height = 29
$ middle = $ height/2+ 1;
$picture=Imagecreate($width,$ height);
$ bgcolor = imagecolorlallocate($ picture,225,250,225);
$ border color = imagecolorlallocate($ picture,0,0,0);
$ f($ picture, 0,0,0);
$ font color 2 = imagecolorlallocate($ picture, 100,0,255);
$ fontcolor3 = imagecolordocument ($ picture, 255, 100,100);
$ orig img = ImageCreateFromPNG(" test . png ");
imagecopyrefized($ picture,$origImg,0,0,0,$width,$height,ImageSX($origImg),ImageSY($ origImg));
Imageline($picture,0,0,$width- 1,0,$ border color);
Imageline($picture,0,0,0,$height- 1,$ border color);
Imageline($ picture, $width- 1, $height- 1, $width- 1, 0, $ bordercolor);
Imageline($ picture, $width- 1, $height- 1, 0, $height- 1, $ bordercolor);
Imageline($ picture, $width- 1, $middle- 1, 0, $middle- 1, $ bordercolor);
Imagestring($picture,2,2,0,$top,$ font color 3);
Imagestring($picture,2,2, 10,$line,$ font color);
Imagestring($picture,2,2,20,$wenzi 1,$ font color);
Imagestring($picture,2,$left+2,20,$ip_real,$ font color);
Imagestring($picture,2,2,32,$wenzi2,$ font color);
Imagestring($picture,2,$left+2,32,$ip_agent,$ font color);
Imagestring($picture,2, 14,44,$User_Agent,$ font color);
Imagestring($picture,2,4,54,$ClientInfo,$ font color);
Imagestring($picture,2,4,62,$time,$ font color);
Imagestring($picture,2,2,72,$line,$ font color);
Imagestring($picture,2,2,84,$info,$ font color 2);
Imagepng($ picture);
Image destroy($ picture);
}
//The above code is aimed at multiple IP addresses, and the principle is the same as that of a single IP.
& gt
You also need a background picture of test.png.