FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Please help images again.





The-Master
I have reasearched this a bit but it does not work Crying or Very sad

Code:
<?php

header("Content-type: image/gif");
$string = $_GET['text'];
$im    = imagecreatefrompng("http://www.dougie.frih.net/images/files.gif");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

?>

Why does it not work and please don't just say, "That is Easy." Laughing
hexkid
The-Master wrote:
Why does it not work


I've taken the liberty to paste your code unquoted and out of code block so that the reds can be seen

<?php

header("Content-type: image/gif"); ### A
$string = $_GET['text'];
$im = imagecreatefrompng("http://www.dougie.frih.net/images/files.gif"); ### B
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im); ### C
imagedestroy($im);

?>

The first line says you're about to output a gif image ... but you end up outputting a png image (lines A and C).
You're also trying to read a gif image as if it was a png (line B).
The-Master
Thanks very much. lol. That was a school boy error!
hexkid
One more thing ...

You read the template image from the webserver
Code:
$im = imagecreatefrompng("http://www.dougie.frih.net/images/files.gif");

I very much prefer to read it directly from the file system
Code:
$im = imagecreatefrompng('/home/dougie/domains/dougie.frih.net/images/files.gif');
Related topics
simple php problem, please help...
A good website idea.........Please help PPL
Please help Me
phpBB2 ERROR PLEASE HELP
Please help. I have a problem with installing FreeBSD
problems with my comp....something strange, please help me
please help me, i don't know anything here...
Problem with MySQL Server Please Help!!
My sound is mono, please help!
Anyone please help me!
64 = 65? Frih$ reward offered! Please help.
VERY URGENT! Please Help Me!
Please Help Me....
Please help about this..
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.