PDA

View Full Version : Gd Libary / Php Help



Matt-
17-12-2006, 11:56 AM
I'm coding a page using gd libary,

http://www.fallypark.com/dynsig/index.jpg?name=Teh_lastp
and error

Fatal error: Call to undefined function: imagettftext() in /home/fallypar/public_html/dynsig/index.jpg on line 38
this is the php for the page..


<?php
$handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$_GET['name'],"r");
if($handle){
while (!feof($handle)) {
$contents .= fread($handle, 8192);}
fclose($handle);}
function GetLvl($skill)
{ $str1 = strstr($GLOBALS['contents'], '>'.chr(10).$skill.chr(10).'<');
if(strpos($str1, 'd co')<30) return '--';
$pos1 = strpos($str1, 't"',strpos($str1, 't"')+1)+3;
return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);}
function GetXP($skill)
{ $str1 = strstr($GLOBALS['contents'], '>'.chr(10).$skill.chr(10).'<');
if(strpos($str1, 'd co')<30) return '--';
$pos1 = strpos($str1, 't"',strpos($str1, 't"',strpos($str1, 't"')+1)+1)+3;
return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);}
function GetRank($skill)
{ $str1 = strstr($GLOBALS['contents'], '>'.chr(10).$skill.chr(10).'<');
if(strpos($str1, 'd co')<30) return '--';
$pos1 = strpos($str1, 't"')+3;
return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);}

function parse($skill){return GetLvl($skill);}

if (GetRank(Overall) == '--') {
echo "RuneScape Name Not Found ";
} else {
$font="ARIAL.TTF";
$imgfile = "sig.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);
$im2 = imagecreatefrompng($imgfile);
imagecopy($im, $im2, 0, 0, 0, 0, $image_width, $image_height);
imagedestroy($im2);
imagettftext($im, 12, 0, 215, 15, $color, $font, $_GET['name']);
imagettftext($im, 12, 0, 230, 90, $color, $font, "Fallypark.com");
imagettftext($im, 12, 0, 215, 30, $color, $font, "Overall: " . parse(Overall));
imagettftext($im, 12, 0, 215, 45, $color, $font, "Rank: " . GetRank(Overall));
imagettftext($im, 12, 0, 215, 60, $color, $font, "XP: " . GetXP(Overall));
imagettftext($im, 12, 0, 25, 15, $color, $font, parse(Attack));
imagettftext($im, 12, 0, 25, 34, $color, $font, parse(Defence));
imagettftext($im, 12, 0, 25, 53, $color, $font, parse(Strength));
imagettftext($im, 12, 0, 25, 72, $color, $font, parse(Hitpoints));
imagettftext($im, 12, 0, 25, 91, $color, $font, parse(Ranged));
imagettftext($im, 12, 0, 62, 15, $color, $font, parse(Prayer));
imagettftext($im, 12, 0, 62, 34, $color, $font, parse(Magic));
imagettftext($im, 12, 0, 62, 53, $color, $font, parse(Cooking));
imagettftext($im, 12, 0, 62, 72, $color, $font, parse(Woodcutting));
imagettftext($im, 12, 0, 62, 91, $color, $font, parse(Fletching));
imagettftext($im, 12, 0, 100, 15, $color, $font, parse(Fishing));
imagettftext($im, 12, 0, 100, 34, $color, $font, parse(Firemaking));
imagettftext($im, 12, 0, 100, 53, $color, $font, parse(Crafting));
imagettftext($im, 12, 0, 100, 72, $color, $font, parse(Smithing));
imagettftext($im, 12, 0, 100, 91, $color, $font, parse(Mining));
imagettftext($im, 12, 0, 140, 15, $color, $font, parse(Herblore));
imagettftext($im, 12, 0, 140, 34, $color, $font, parse(Agility));
imagettftext($im, 12, 0, 140, 53, $color, $font, parse(Thieving));
imagettftext($im, 12, 0, 140, 72, $color, $font, parse(Runecraft));
imagettftext($im, 12, 0, 140, 91, $color, $font, parse(Slayer));
imagettftext($im, 12, 0, 180, 15, $color, $font, parse(Farming));
imagettftext($im, 12, 0, 180, 53, $color, $font, parse(Hunter));
imagettftext($im, 12, 0, 180, 34, $color, $font, parse(Construction));
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
}
?>And my servers gd dump..

http://www.fallypark.com/dynsig/gd.php

anyideas?

Want to hide these adverts? Register an account for free!