Hi,
To explain more what im asking about ill give you an example to go from that I really like Here Ive only been mildy successful in making the random quote work in the form of a fortune cookie thing that I read how to do on the web, It works well but I must call the actuall script into action for it to show the image, which is a problem because Its more work thatn Id like to do just to have it work on a forum, I like how the example one s called using the [img] tag as this is ideal for my forum, ive been told that perhpas using a redirect in a .htaccess file would resolve this issue but I dont know much about htacess files. I have the superglobals picked out but I have no idea how to make them print their values to the image file on a seperate line....If anyone could help me out that would be a great thing because ive had no luck with googling. I have a fair knowledge of php but not in this area (messin with GD functions n images n all that) but would like to learn.
Before I forget this is the code for what Ive obtained so far
<?php
// Set the static variables
$font_file = $_SERVER['DOCUMENT_ROOT']."/path/verdana.ttf";
$font_size = 8;
$y_start = 53;
$angle = 0;
$max_width = 300;
// Retrieve random fortune from text file
$fortune_array = file("fortunes.txt");
srand((double) microtime() * 10000000);
$fortune = array_rand($fortune_array);
// Calculate horizontal starting point for the text
$line_width = imagettfbbox($font_size, 0, $font_file, $fortune_array[$fortune]);
$x_start = (($max_width - $line_width[2] - $line_width[0]) / 2) + 50;
// Create the image resource and assign colors to variables
header("Content-type: image/png");
$im = imagecreatefrompng("blank.png");
$red = imagecolorallocate($im, 255, 0, 0);
// Write the text to the image
imagettftext($im, $font_size, $angle, $x_start, $y_start, $red, $font_file, $fortune_array[$fortune]);
// Create and then destroy the image
imagepng($im);
imagedestroy($im);
?>