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


what is the problem with this script





mahirharoon
what is the problem in code here
this should write text on the preferred image but it did not write , why ?
Code:

<?php
//define header
@header("Content-type: image/png");
//define variables
$t = $_get["t"];
//what to copy there
$fl = "hb.png";
//create image
$im = imagecreate(174,25);
//background
$bg = imagecolorallocate($im,255,255,255);
//text colour
$textcolor = imagecolorallocate($im, 0, 0, 0);
//copy image
imagecreatefrompng($fl);
//write defined get variable
imagestring($im, 3, 0, 0, "$t", $textcolor);
//out put it
imagepng($im);
?>
kv
actually, you are creating a new image alltogether and using it. you are calling imagecreatefrompng, but the image opened is not assigned to $im. All you need to do is open png using imagecreatefrompng and write a string on top of it.

Code:

<?
$fl = "hb.png";
//copy image
$im=imagecreatefrompng($fl);
//write defined get variable
imagestring($im, 3, 0, 0, "$t", $textcolor);
//out put it
imagepng($im);
?>
Related topics
phpbb problem....
Need a script - navigation
Navigation Script (javascript) Help Please!
I can't upload my Database SQL script ! Helllppppp!!!!
problem with a php randomizer script
Php script Cod server stats
SDRAM vs DDRAM
A PHP problem !
MySQL DB Backup script - minor problem
Script Problem
Problem with a script
Script problem
PHP login script problem
Problem with galary script
" Fatal error: Allowed memory size of 52428800" bl
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.