I run a Profile site where users can upload their pictures and write info about themselves ... and so on ...
Im working on adding a new feature where users can choose a font & colour for the top of there profile page: 'Admins Profile' etc.
As the fonts are custom fonts ive downloaded of the internet, i couldnt create a path to get the font from my server, so im using ImageTTFText to do it.
My Current coding was:
<?
$un = $pDetails['username'];
//Gets the Profiles Username
$text = mysql_query("SELECT * FROM crib_tools WHERE username='".$_GET['username']."'");
if (mysql_num_rows($text)==1){
//Checks if the user has selected a font n colour
while ($getText = mysql_fetch_array($text)){
$font = $getText['font'];
$colour = $getText['colour'];
echo "<font color=\"$colour\" size=\"4\" face=\"$font\">$un's Profile</font></span>";
}
} else {
echo "<font color=\"#000000\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$un's Profile</font>";
}
?>
Which didnt work due to it not getting the font.
But now i want to add this piece of coding and integrate it with my existing code (above).
Header ("Content-type: image/gif");
$im = imagecreate (400, 30);
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 10, 20, $white, "/fonts/CARTOON_.TTF", "Testing... Will display username here");
ImageGif ($im);
ImageDestroy ($im);
Ive really tried everything i can think of on how to integrate the code, but I am completely confussed.
Can anyone help me please??