View Single Post
Old 01-01-2009, 08:44 PM   #14 (permalink)
tego10122
The Contributor
 
tego10122's Avatar
 
Join Date: Sep 2008
Location: Miami
Posts: 39
Thanks: 7
tego10122 is on a distinguished road
Default

Quote:
Originally Posted by kokjj87 View Post
You can't have both html and picture render in the same page, because the header("Content-type: image/jpeg"); header would tell the browser to render it as a jpg page, instead of a html page..

In order to get this working, you need to separate this 2 file.


//The image file
PHP Code:
<?php
$text 
$_GET['text'];

class 
image
    
{
        public function 
text($variable)
        {
            
$image imagecreate(200,25);

            
imagecolorallocate($image255255255);

            
$fontColor imagecolorallocate($image000);

            
$startX     15;
            
$startY     5;
            
$string "$variable";
            
imagestring($image3$startX$startY$string$fontColor);
            
header("Content-type: image/jpeg");
            
imagejpeg($image);
            
imagedestroy($image);
        }
    }
    
$image = new image();
    echo 
$image->text($text);
?>


//the html page
PHP Code:
<?php
echo 'this is the html page.<br/>';
echo 
'<img src="PATHTOTHEIMAGEFILE?text=YOUR TEXT HERE"/>';
?>

Since your are parsing a email, so it is quite sensitive, so rather than passing the email as the parameter, i would recommend you to query the database and get the email for parsing on your image side.


I see what you are saying, but im basically trying to use this string to generate text into image , not to watermark images.
__________________
You're Everyday Graphic Artist
Twitter|GigPark|Linked In
Send a message via MSN to tego10122
tego10122 is offline  
Reply With Quote