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

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

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. Huh?  PHP help needed
I already posted this on a php forum, but it's been a day without an answer so i thought I might post it here...

I'm trying to make a random quote script, I have a txt file with the quotes, every line a new one, this works... But I want to output it on a image and this is where  I need the help.

I want the image to get the size of the line automaticly (so ig the text is Ezra it should be as long as that, and if it's longer it should get wider automaticly), but i also want it too not get too long, like max 300px and if the line is longer, I want it to continue on the next line.
Like this:
Ezra is
cool

This is the code I have so far:
code:
<?
//Header information
header("Content-type: image/gif");

//Get the quote from the file
function randomNummer($van, $tot)
{
    srand ((double) microtime() * 1000000); // seed the generator
    $return = rand($van,$tot);
     
    return($return);
}

$textLijst = 'randomquote.txt'; // the quotes are in here, on every line a new quote..

$textArray = file($textLijst); // The lines in an array.

$textCount = count($textArray); // How many lines are there??

$randomRegelNummer = randomNummer(0, ($textCount - 1)); // the number of a line.

$textRegel = $textArray[$randomRegelNummer]; // a random line number from the file

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

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

?>

This post was edited on 04-17-2005 at 08:34 PM by Ezra.
[Image: 1-0.png]
             
04-17-2005 05:22 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP help needed - by Ezra on 04-17-2005 at 05:22 PM
RE: PHP help needer - by KeyStorm on 04-17-2005 at 05:53 PM
RE: PHP help needer - by Ezra on 04-17-2005 at 07:32 PM
RE: PHP help needed - by KeyStorm on 04-17-2005 at 08:56 PM
RE: PHP help needed - by Ezra on 04-17-2005 at 09:25 PM
RE: PHP help needed - by KeyStorm on 04-17-2005 at 09:42 PM
RE: PHP help needed - by Ezra on 04-17-2005 at 09:47 PM
RE: PHP help needed - by KeyStorm on 04-17-2005 at 09:54 PM
RE: PHP help needed - by Ezra on 04-18-2005 at 12:07 PM
RE: PHP help needed - by KeyStorm on 04-18-2005 at 12:56 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