I'm not too good at the whole modrewrite stuff so I tried another method I found on the web where you name a directory status.jpg then just place the script as the index.php file of that directory.... then you can link to mydomain.com/status.jpg
...saying that, I'm still not having any luck so here's the code I'm using:
It's just a bit of a test for now, so just ignore the output:
<?php
//Connect to Database
include('../../DB-connect.php');
//Get UserID
$id = 1;
//Get First Name
$result = mysql_query("SELECT FirstName FROM usersWHERE id = $id");
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$FirstName = $row['FirstName'];
}
$text = 'My name is '.$FirstName;
make_wrapped_txt($text, '053871', 2, 2, 550);
function make_wrapped_txt($txt, $color = 000000, $space = 4, $font = 4, $w = 500)
{
if (strlen($color) != 6)
$color = 000000;
$int = hexdec($color);
$h = imagefontheight($font);
$fw = imagefontwidth($font);
$txt = explode("\n", wordwrap($txt, ($w / $fw), "\n"));
$lines = count($txt);
$im = imagecreate($w, (($h * $lines) + ($lines * $space)));
$bg = imagecolorallocate($im, 255, 255, 255);
$color = imagecolorallocate($im, 0xFF & ($int >> 0x10), 0xFF & ($int >> 0x8),
0xFF & $int);
$y = 0;
foreach ($txt as $text)
{
$x = (($w - ($fw * strlen($text))) / 2);
imagestring($im, $font, $x, $y, $text, $color);
$y += ($h + $space);
}
header('Content-type: image/jpeg');
die(imagejpeg($im));
}
?>
Thanks