Creating "Your IP is" images
PHP Coding Tutorials | Submited May 12, 2008
Written by: 
This shows you how to create the all-too-popular "Your IP is" banners that a lot of people have in their signatures.
Notes

This is just a basic guide, it leaves much to be desired, but that's a good thing, no?
Anyways, it's pretty simple, and if you don't get it you can just tinker with the full script included at the bottom.
Note: I just did this last night, so feel free to point out any inaccuracies.
Step One - Header
For step one, obviously, we open the PHP tags, and set the header to image, other wise it just won't work right.
<?php
header ('Content-type: image/png');
I'm not going to explain things that are obvious, which "image/png" is, right?
Step Two - Variables
This is where we'll create the variables to make the script less cluttered.
$doImage = imageCreateFromPNG('http://sevenbeasts.com/banner.png');
$color = ImageColorAllocate ($doImage, 136, 136, 136);
$ip = $_SERVER['REMOTE_ADDR'];
$doImage is what we base the image off, I used a simple black square, nothing too fancy.
$color is the colors we'll use, I used #555, which in RGB values converts to 136, 136, 136.
$ip is simply what detects the IP address
Step Three - Compile the Image
Here we'll put the variables to use with PHP image functions:
ImageString ($doImage, 2, 25, 5, "Your IP is $ip", $color);
ImageString ($doImage, 2, 65, 16, "I pwn DanaSoft", $color);
ImagePng ($doImage);
ImageDestroy ($doImage);
?>
ImageString(1) is like this:
Use the black banner, text size is 2, place it 25px from the left, 5px from the top, use text "Your IP is [IP VAR], and $color is #555.
The second one works in that same pattern.
ImagePNG confirms that the image is, in fact, PNG.
Does Image
Destroy really need to be explained?
?> is the clsing PHP tag. You didn't even remember we opened it, did you? -_-
All-together
<?php
Header ("Content-type: image/png");
$doImage = imageCreateFromPNG("http://sevenbeasts.com/banner.png");
$color = ImageColorAllocate ($doImage, 136, 136, 136);
$ip = $_SERVER['REMOTE_ADDR'];
ImageString ($doImage, 2, 25, 5, "Your IP is $ip", $color);
ImageString ($doImage, 2, 65, 16, "I pwn DanaSoft", $color);
ImagePng ($doImage);
ImageDestroy ($doImage);
?>