hello,
I started yesterday with bluehost, and I try work with image. I get a script from php.net, and I start with the resource "imagecreate" (http://pt2.php.net/manual/en/function.imagecreate.php).
I try make a image with this code:
---------------------
---------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
</body>
</html>
--------------------------
--------------------------
But in the browser not appear the image, just appear text:
---------------------
---------------------
Warning: Cannot modify header information - headers already sent by (output started at /home/gloradin/public_html/fotos/index5.php:9) in /home/gloradin/public_html/fotos/index5.php on line 10
‰PNG IHDRnV,šPLTEé[an÷fIDAT•c` `fxÄÀÃ`Ç ÀçÀä²41ƒ‚€˜Ë–Ý’Àq²@੤;{á0— œi
-------------------------------
-------------------------------
The site for view the exemple is http://fotos.gloradin.com/index5.php.
Please help me for a good solution.
The best regards,
Gloradin


Reply With Quote