("Content-type:image/gif"= Imagecreate (130,15= Imagecolorallocate (, 255, 255, 255(
([' http_client_ip '
=[' http_client_ip '
( Span $_server< span>[' http_x_forwarded_for '
=[' HTTP_X_ Forwarded_for '
=[' REMOTE _addr '
= imagecolorallocate ( , 0, Wuyi, 102
, 3, 5, 1, ,
?>
2. Header ("Content-type:image/gif");
The second line declares that the browser header output is GIF graphics
3. $im = Imagecreate (130,15);
Create a graphic imagecreate (130,15) in brackets 130, 15 for width and height, respectively
4. $background _color = imagecolorallocate ($im, 255, 255, 255);
Set the background color imagecolorallocate to assign a color to a picture ($im, 255, 255, 255) IM represents the 10 binary characters of the color table ffffff that represent the 3 255 behind the new shape mentioned earlier
5. unset ($IP);
Useless
6.if ($_server[' http_client_ip ')} {
$ip =$_server[' http_client_ip '];
} else if ($_server[' http_x_forwarded_for ']) {
$ip =$_server[' http_x_forwarded_for '];
} else{
$ip =$_server[' remote_addr '];
}
If $_server[' http_client_ip ' can be used then using $_server[' Http_client_ip ') is similar to judging this paragraph to be compatible with a variety of server settings
7. $col = Imagecolorallocate ($im, 0, 51, 102);
Define text color
8. Imagestring ($im, 3, 5, 1, $ip, $col);
The acquired IP is drawn onto the newly created canvas imagestring ($im, 3, 5, 1, $ip, $col); Represents imagestring (graphic representation, character size 1-5,x coordinates, y-coordinate, output IP, color), respectively
9. Imagegif ($im);
Output GIF Graphics
Imagedestroy ($im);
Freeing memory
?>.
End of program
http://www.bkjia.com/PHPjc/714718.html www.bkjia.com true http://www.bkjia.com/PHPjc/714718.html techarticle ? ("Content-type:image/gif" = imagecreate (130,15 = Imagecolorallocate (, 255, 255, 255 ([' http_client_ip ' = [' HTTP_CLIE Nt_ip ' ([' http_x_forwarded_for ' = [' Http_x_forwarded_fo ...