[code=php]<?php
//Connect to the database and select the data from the table
$username="asdf asdf";
$password="asdf asdf";
$database="asdf asdf";
mysql_connect(l ocalhost,$usern ame,$password);
@mysql_select_d b($database) or die("Unable to select database");
$query="SELECT * FROM ut_players";
$result=mysql_q uery($query);
$num=mysql_numr ows($result);
mysql_close();
//Pull out the data
$name=mysql_res ult($result,$i, "plr_name") ;
$frags=mysql_re sult($result,$i ,"plr_frags" );
$score=mysql_re sult($result,$i ,"plr_score" );
$mlseconds=mysq l_result($resul t,$i,"plr_time" );
$hours = floor($mlsecond s / 360000);
//Generate the main static background
$width = 400;
$height = 50;
$image = ImageCreate($wi dth, $height);
$string = "test";
$white = ImageColorAlloc ate($image, 255, 255, 255);
$black = ImageColorAlloc ate($image, 0, 0, 0);
ImageFill($imag e, 0, 0, $black);
ImageFtText($im age, $pointsize, 0, 0, $white, $string);
header("Content-Type: image/jpeg");
ImageJpeg($imag e);
ImageDestroy($i mage);
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Here is the error I get when I get to the web page:
Call to undefined function: imagefttext
I know the script may seem a little random, but all I was trying to get it to do was print the string "test" on to the image so that when viewed in the browser someone would see the word test on the image. Any help?
Thanks much,
Dennis
//Connect to the database and select the data from the table
$username="asdf asdf";
$password="asdf asdf";
$database="asdf asdf";
mysql_connect(l ocalhost,$usern ame,$password);
@mysql_select_d b($database) or die("Unable to select database");
$query="SELECT * FROM ut_players";
$result=mysql_q uery($query);
$num=mysql_numr ows($result);
mysql_close();
//Pull out the data
$name=mysql_res ult($result,$i, "plr_name") ;
$frags=mysql_re sult($result,$i ,"plr_frags" );
$score=mysql_re sult($result,$i ,"plr_score" );
$mlseconds=mysq l_result($resul t,$i,"plr_time" );
$hours = floor($mlsecond s / 360000);
//Generate the main static background
$width = 400;
$height = 50;
$image = ImageCreate($wi dth, $height);
$string = "test";
$white = ImageColorAlloc ate($image, 255, 255, 255);
$black = ImageColorAlloc ate($image, 0, 0, 0);
ImageFill($imag e, 0, 0, $black);
ImageFtText($im age, $pointsize, 0, 0, $white, $string);
header("Content-Type: image/jpeg");
ImageJpeg($imag e);
ImageDestroy($i mage);
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Here is the error I get when I get to the web page:
Call to undefined function: imagefttext
I know the script may seem a little random, but all I was trying to get it to do was print the string "test" on to the image so that when viewed in the browser someone would see the word test on the image. Any help?
Thanks much,
Dennis
Comment