In this tutorial you learn how to create dynamic pics like this:
I hope you like it and understand it:
1. mode_rewrite must be activated on your webspace.
2.Choice it should be a .png .gif or .jpg:
Note: I use .png in this tut.
Now we choice a background-image. It doesnt matter how big the your picture is (not too small for the text, not too big..).
3.Now we choice which picture to load:
Now we choice what you should see on the pic.
In this tut I make an information about OS, IP etc.
4.Colors:
We have to define the colors:
You can also use your colors
Google will give a hand.
Das Auslesen der Infos:
Now we read out the information about your PC with [HTTP_USER_AGENT]
And now the OS:
host and ip:
Now we have to create the text.
We need position and size of the letters, font, color and the text:
Only Example: ($img, 12, 0, 120, 45, $black, "fonts/kr1.ttf", "Dein OS ist: ")
12 is the letter´s size, 0 width of the letters, 120 beginning of the letter ,45 beginning of the letter from the top .
fonts/kr1.ttf: Download a font here http://www.myfont.de/fonts/techno/shadowed-3d-2.html, put it in "fonts" file and change the name.
You can also change Positions:
i
And at the end:

All in one :
here is mine :
Post questions etc. here

I hope you like it and understand it:
1. mode_rewrite must be activated on your webspace.
2.Choice it should be a .png .gif or .jpg:
Code:
<?
header("Content-type: image/png"); // For a PNG
//header("Content-type: image/jpeg"); // For a JPG
//header("Content-type: image/gif"); //For a Gif
?>
Note: I use .png in this tut.
Now we choice a background-image. It doesnt matter how big the your picture is (not too small for the text, not too big..).
3.Now we choice which picture to load:
Code:
$img = imagecreatefrompng("your_pic.png"); //if the picture is in other path e.g. /img/your_pic.png
Now we choice what you should see on the pic.
In this tut I make an information about OS, IP etc.
4.Colors:
We have to define the colors:
Code:
$white = imagecolorallocate($img,255,255,255);
$black = imagecolorallocate($img,0,0,0);
$red = imagecolorallocate($img,255,0,0);
$blue = imagecolorallocate($img,0,0,255);

Das Auslesen der Infos:
Now we read out the information about your PC with [HTTP_USER_AGENT]
Code:
/ reading out
if (ereg( 'MSIE',$_SERVER[HTTP_USER_AGENT])) {
if (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 5.0')) {
$browser = "Internet Explorer 5";
} elseif (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 5.5')) {
$browser = "Internet Explorer 5.5";
} elseif (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 6.0')) {
$browser = "Internet Explorer 6";
} else {
$browser = "Internet Explorer";
}
} elseif (ereg( 'Opera',$_SERVER[HTTP_USER_AGENT])) {
$browser = "Opera";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Firefox")) {
$browser = "Firefox";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Safari")) {
$browser = "Safari";
} elseif (ereg("Lynx", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "Lynx";
} elseif(ereg("WebTV", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "WebTV";
} elseif(ereg("Konqueror", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "Konqueror";
} elseif (ereg( 'Mozilla/([0-9].[0-9]{1,2})',$_SERVER[HTTP_USER_AGENT])) {
$browser = "Mozilla";
} else {
$browser = "Unknown";
}
And now the OS:
Code:
// reading out OS
if (strstr($_SERVER[HTTP_USER_AGENT], "Windows 95")) {
$os = "Windows 95";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Windows 98")) {
$os = "Windows 98";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 4.0")) {
$os = "Windows NT";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 5.0")) {
$os = "Windows 2000";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 5.1")) {
$os = "Windows XP";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Win")) {
$os = "Windows";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Mac")) {
$os = "MacOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Linux")) {
$os = "Linux";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "FreeBSD")) {
$os = "FreeBSD";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "SunOS")) {
$os = "SunOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "IRIX")) {
$os = "IRIX";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "BeOS")) {
$os = "BeOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "OS/2")) {
$os = "OS/2";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "AIX")) {
$os = "AIX";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Unix")) {
$os = "Unix";
} else {
$os = "Unknown system";
}
host and ip:
Code:
// reading out ip and host
$ip = getenv("REMOTE_ADDR");
$host = gethostbyaddr($ip);
We need position and size of the letters, font, color and the text:
Only Example: ($img, 12, 0, 120, 45, $black, "fonts/kr1.ttf", "Dein OS ist: ")
12 is the letter´s size, 0 width of the letters, 120 beginning of the letter ,45 beginning of the letter from the top .
fonts/kr1.ttf: Download a font here http://www.myfont.de/fonts/techno/shadowed-3d-2.html, put it in "fonts" file and change the name.
You can also change Positions:
i
Code:
magettftext($img, 12, 0, 120, 45, $black, "fonts/kr1.ttf", "Dein OS ist: ");
imagettftext($img, 12, 0, 200, 45, $red, "fonts/kr1.ttf", "". $os);
imagettftext($img, 12, 0, 120, 60, $black, "fonts/kr1.ttf", "Your browser: ");
imagettftext($img, 12, 0, 230, 60, $blue, "fonts/kr1.ttf", "". $browser);
imagettftext($img, 12, 0, 120, 75, $black, "fonts/kr1.ttf", "your ip: ");
imagettftext($img, 12, 0, 230, 75, $red, "fonts/kr1.ttf", "". $ip);
imagettftext($img, 12, 0, 120, 90, $black, "fonts/kr1.ttf", "your host: ");
imagettftext($img, 12, 0, 120, 105, $blue, "fonts/kr1.ttf", "". $host);
Code:
imagepng($img);

All in one :
Code:
<?
header("Content-type: image/png"); // for a PNG
//header("Content-type: image/jpeg"); //for a JPG
//header("Content-type: image/gif"); //for a Gif
$img = imagecreatefrompng("s.png"); //name of you background pic!
$white = imagecolorallocate($img,255,255,255);
$black = imagecolorallocate($img,0,0,0);
$red = imagecolorallocate($img,255,0,0);
$blue = imagecolorallocate($img,0,0,255);
// Auslesen der Browser
if (ereg( 'MSIE',$_SERVER[HTTP_USER_AGENT])) {
if (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 5.0')) {
$browser = "Internet Explorer 5";
} elseif (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 5.5')) {
$browser = "Internet Explorer 5.5";
} elseif (strstr($_SERVER[HTTP_USER_AGENT],'MSIE 6.0')) {
$browser = "Internet Explorer 6";
} else {
$browser = "Internet Explorer";
}
} elseif (ereg( 'Opera',$_SERVER[HTTP_USER_AGENT])) {
$browser = "Opera";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Firefox")) {
$browser = "Firefox";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Safari")) {
$browser = "Safari";
} elseif (ereg("Lynx", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "Lynx";
} elseif(ereg("WebTV", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "WebTV";
} elseif(ereg("Konqueror", $_SERVER["HTTP_USER_AGENT"])) {
$browser = "Konqueror";
} elseif (ereg( 'Mozilla/([0-9].[0-9]{1,2})',$_SERVER[HTTP_USER_AGENT])) {
$browser = "Mozilla";
} else {
$browser = "Unknown";
}
// OS
if (strstr($_SERVER[HTTP_USER_AGENT], "Windows 95")) {
$os = "Windows 95";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Windows 98")) {
$os = "Windows 98";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 4.0")) {
$os = "Windows NT";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 5.0")) {
$os = "Windows 2000";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "NT 5.1")) {
$os = "Windows XP";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Win")) {
$os = "Windows";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Mac")) {
$os = "MacOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Linux")) {
$os = "Linux";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "FreeBSD")) {
$os = "FreeBSD";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "SunOS")) {
$os = "SunOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "IRIX")) {
$os = "IRIX";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "BeOS")) {
$os = "BeOS";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "OS/2")) {
$os = "OS/2";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "AIX")) {
$os = "AIX";
} elseif (strstr($_SERVER[HTTP_USER_AGENT], "Unix")) {
$os = "Unix";
} else {
$os = "unknown system";
}
// pi and host
$ip = getenv("REMOTE_ADDR");
$host = gethostbyaddr($ip);
imagettftext($img, 12, 0, 120, 45, $black, "fonts/Sisterv2.ttf", "your os: ");
imagettftext($img, 12, 0, 200, 45, $red, "fonts/Sisterv2.ttf", "". $os);
imagettftext($img, 12, 0, 120, 60, $black, "fonts/Sisterv2.ttf", "your browser: ");
imagettftext($img, 12, 0, 230, 60, $blue, "fonts/Sisterv2.ttf", "". $browser);
imagettftext($img, 12, 0, 120, 75, $black, "fonts/Sisterv2.ttf", "your ip: ");
imagettftext($img, 12, 0, 230, 75, $red, "fonts/Sisterv2.ttf", "". $ip);
imagettftext($img, 12, 0, 120, 90, $black, "fonts/Sisterv2.ttf", "your host: ");
imagettftext($img, 12, 0, 120, 105, $blue, "fonts/Sisterv2.ttf", "". $host);
ImagePNG($img);
?>
here is mine :
Post questions etc. here