rendered paste body $query = "SELECT * FROM userdata WHERE username = CONVERT( _utf8 '$per' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0 , 1";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
$user=$r['username'];
$cb=$r['combat'];
$overall=$r['overall'];
$rank=$r['rank'];
$xp=$r['xp'];
$att=$r['attack'];
$def=$r['defence'];
$str=$r['strength'];
$hp=$r['hp'];
$ranged=$r['ranged'];
$prayer=$r['prayer'];
$mage=$r['magic'];
$cook=$r['cooking'];
$wc=$r['woodcutting'];
$fletch=$r['fletching'];
$fish=$r['fishing'];
$fm=$r['firemaking'];
$craft=$r['crafting'];
$smith=$r['smithing'];
$mine=$r['mining'];
$herb=$r['herblore'];
$agility=$r['agility'];
$thief=$r['theiving'];
$slay=$r['slayer'];
$farm=$r['farming'];
$rc=$r['runecraft'];
$hunt=$r['hunter'];
$construction=$r['construction'];
}
$nav = $_SERVER["REQUEST_URI"];
$script = $_SERVER["SCRIPT_NAME"];
$nav = ereg_replace("^$script", "", $nav);
$nav = str_replace("%20"," ",$nav);
$vars = explode("/", $nav);
$per = substr($vars[2],0,strpos($vars[2],"."));
$backg = strtolower($vars[1]);
$per = ucfirst(strtolower($per));
$font="./bg/lilith.TTF";
$imgfile = "./bg/".$backg.".png";
$im_size = getimagesize($imgfile);
$image_width = $im_size[0];
$image_height = $im_size[1];
$im = imagecreatetruecolor($image_width, $image_height);
$color = imagecolorallocate($im, 255, 255, 255);
$color2 = imagecolorallocate($im, 0, 0, 0);
$im2 = imagecreatefrompng($imgfile);
imagecopy($im, $im2, 0, 0, 0, 0, $image_width, $image_height);
imagedestroy($im2);
imagettftext($im, 16, 0, 190, 25, $color, $font, $per);
imagettftext($im, 16, 0, 140, 25, $color, $font, $att);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);