I have been following a tutorial for making a dynamic image. http://www.msfn.org/board/dynamic-signa ... 47730.html
I have GD installed on my server and i the following code from the tutorial:
Code: Select all
<?php
Header ('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');
// set the dimensions
$img_width = 240;
$img_height = 25;
// create the image
$image = imagecreate($img_width, $img_height);
// set the colours
$cool = imagecolorallocate($image, 81, 86, 96);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);
// set the background colour
// number or is top left pixel x, top left pixel y, bottom right pixel x, bottom right pixel y
imagefilledrectangle($image, 0, 0, $img_width, $img_height, $cool);
// set the font and print text
$font = '/path/to/your/ttf/font/verdana.ttf';
// now i will create a line with font size 8, with no angle, 10 pixels to the right, and 17 pixels down
ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);
// the above will display your IP address
// output and destroy
imagepng($image);
imagedestroy($image);
?>p.s: i thought something wrong with my server config but i tried it on 3 different servers with GD installed.
Astro