I have the following code that is outputting some strange characters behind my username in my PNG image. It is also saving the file (using the username) with apparantly a number of spaces.
Anyone know a fix for this? I have tried various things...cannot figure out why this is happening.
Here is the image, please note the odd VNTL after "Medar": 
Here is the way it is being saved: http://www.bladekeep.com/planetside/png/
Here is my code!
<?php
require ("/home/medar/public_html/forums/main.inc.php");
$result = mysql_query("SELECT * FROM ps_charinfo");
if ($myrow = mysql_fetch_array($result)) {
do {
$un = $myrow["username"];
$cf = $myrow["charface"];
$cr = $myrow["commandrank"];
$br = $myrow["battlerank"];
$op = $myrow["outfitpoints"];
$tek = $myrow["totalenemykills"];
$llo = $myrow["lastloggedon"];
printf("%s - %s - %s - %s - %s - %s - %s<br />\n",$myrow["username"],$myrow["charface"],$myrow["commandrank"],$myrow["battlerank"],$myrow["outfitpoints"],$myrow["totalenemykills"],$myrow["lastloggedon"]);
$filename = "png/$un.png";
$img = ImageCreate(310,100);
$nc = ImageCreateFromPNG("nc.png");
imagecopy ($img, $nc, 272, 8, 0, 0, 31, 27);
$back = ImageColorAllocate($img, 1, 20, 60);
$border = ImageColorAllocate($img, 48, 57, 75);
$white = ImageColorAllocate($img, 255, 255, 255);
$yellow = ImageColorAllocate($img, 252, 216, 0);
$black = ImageColorAllocate($img, 0, 0, 0);
// fill image
ImageFill($img, 0, 0, $back);
// write strings
ImageString($img, 3, 69, 5, "$un", $white);
ImageString($img, 1, 69, 21, "New Conglomerate on Emerald", $yellow);
ImageString($img, 3, 69, 35, "Sacred Silver Blades ($op):", $white);
ImageString($img, 3, 69, 47, "Battlerank:", $white);
ImageString($img, 2, 164, 47, "$br", $white);
ImageString($img, 3, 69, 59, "Command Rank:", $white);
ImageString($img, 2, 164, 59, "$cr", $white);
ImageString($img, 3, 69, 71, "Total Kills:", $white);
ImageString($img, 2, 164, 71, "$tek", $white);
ImageString($img, 1, 202, 86, "www.bladekeep.com", $yellow);
ImageLine($img, 1, 1, (61), 1, $border);
ImageLine($img, 1, 98, (61), 98, $border);
ImageLine($img, 1, 1, (1), 98, $border);
ImageLine($img, 61, 1, (61), 98, $border);
ImageLine($img, 63, 1, (308), 1, $border);
ImageLine($img, 63, 98, (308), 98, $border);
ImageLine($img, 63, 1, (63), 98, $border);
ImageLine($img, 308, 1, (308), 98, $border);
ImageFilledRectangle($img, 2, 2, 60, 97, $black);
// create image
Imagepng($img, $filename);
// release from memory
ImageDestroy($img);
}
while ($myrow = mysql_fetch_array($result));
}
else { echo "No active members?";
}
?>