What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP GD help

PHP GD help
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. PHP GD help
I made a small code to make a random text-sig some while ago, and today I added Sign the Petition to it, but I realised it was too small to fit the text, so I made it double the size, but not it doesn't look nice with smaller texts anymore...


Anywaaaay, what im trying to ask is :P, can someone help me to make it auto-adjust the size to the text.

I already tried it with imagettfbox but couldn't get it to work. Because I don't think my server can use ttf font's, and I can't change any settings cause it's my hosting company's server.

TIA

And below my code :)

code:
<?php


//randomizer
srand((float) microtime() * 10000000);
$input = array("Ezra", "TSDME", "MsgPlus!", "Nintendo", "SPAM", "Web2Messenger", "Sign the Petition");
$rand_keys = array_rand($input, 2);
$string =  $input[$rand_keys[0]];

//Header info
header("Content-type: image/gif");

//
$im = @imagecreate(160, 20);
$background_color = imagecolorallocate($im, 100, 100, 100);
$text_color = imagecolorallocate($im, 000, 000, 200);

//
imagecolortransparent($im, $background_color);
imagestring($im, 5, 7, 3, $string, $text_color);
imagegif($im);
imagedestroy($im);

//statistics
include_once('connection.inc.php');
opendb();

$query = "SELECT * FROM stats";
$result = mysql_query($query);

while($row = mysql_fetch_array($result)){
$sts = ($row[stats]) + 1;
}

$sql = "UPDATE stats
           SET stats = '$sts'";
             
mysql_query($sql);
?>


[Image: 1-0.png]
             
09-08-2005 07:35 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP GD help - by Ezra on 09-08-2005 at 07:35 PM
RE: PHP GD help - by KeyStorm on 09-08-2005 at 07:57 PM
RE: PHP GD help - by Ezra on 09-08-2005 at 08:03 PM
RE: PHP GD help - by KeyStorm on 09-08-2005 at 08:16 PM
RE: PHP GD help - by Ezra on 09-08-2005 at 11:02 PM
RE: PHP GD help - by brian on 09-08-2005 at 11:09 PM
RE: PHP GD help - by Ezra on 09-08-2005 at 11:24 PM
RE: PHP GD help - by KeyStorm on 09-09-2005 at 01:35 PM
RE: PHP GD help - by Ezra on 09-09-2005 at 02:37 PM
RE: PHP GD help - by L. Coyote on 09-09-2005 at 02:40 PM
RE: PHP GD help - by -dt- on 09-09-2005 at 02:46 PM
RE: PHP GD help - by KeyStorm on 09-09-2005 at 02:48 PM
RE: PHP GD help - by Ezra on 09-09-2005 at 03:07 PM
RE: PHP GD help - by KeyStorm on 09-09-2005 at 03:36 PM
RE: PHP GD help - by Ezra on 09-09-2005 at 04:14 PM
RE: PHP GD help - by KeyStorm on 09-09-2005 at 05:06 PM
RE: PHP GD help - by Ezra on 09-09-2005 at 05:30 PM
RE: PHP GD help - by KeyStorm on 09-09-2005 at 05:33 PM
RE: PHP GD help - by Ezra on 09-09-2005 at 06:03 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On