An example of using a picture displaying a visiter IP

xiaoxiao2021-03-06  111

Header ("Content-Type: Image / PNG");

$ myip = $ regote_addr;

$ IM = ImageCreate (158, 35);

$ bkg = imagecoloralloccate ($ IM, 128, 128, 128); // background color

$ red = imagecoloralloccate ($ IM, 204, 204, 204); // Red

$ Blue = ImageColoralLocate ($ IM, 255, 255, 255); // Blue

For ($ I = 0; $ I

Imagestring ($ IM, 3, $ I * 10 5, 0, Substr ($ Myip, $ I, 1), $ Blue); // ImageColoralLocate ($ IMAGECOLORALLOCATE ($ IM, RAND (5, 255), Rand (5, 255 ), RAND (5, 255)) is changed to become random color

}

Imagestring ($ IM, 3, 5, 10, "------------------", $ RED);

ImageString ($ IM, 3, 20, 20, "Designed by Arcow", $ RED);

ImagePNG ($ IM);

ImageDestroy ($ IM);

?>

转载请注明原文地址:https://www.9cbs.com/read-103757.html

New Post(0)