12-31-2008, 10:04 AM
|
#11 (permalink)
|
|
The Wanderer
Join Date: Oct 2008
Posts: 18
Thanks: 0
|
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($image, 255, 255, 255);
$fontColor = imagecolorallocate($image, 0, 0, 0);
$startX = 15; $startY = 5; $string = "$variable"; imagestring($image, 3, $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.
|
|
|
|