headers already sent --help needed [solved]
Posted: Thu Jun 16, 2005 10:11 am
Alright, I'm completley clueless here. I've been trying to get this class up and running for the last day or two and I'm now to the point where I'm getting a
The calling file that gives me the error:
Here's the only function that returns any header info, or prints anything inside my class text2image-class.php
Note: I do have the Set_Text, Create_Image and Show_Image functions returning true on success and false otherwise.
Why am I getting this error?:
Paul
message. I know it happens when you print something before you sene dthe headers, however, I'm not creating any html. Please help, I'm stumped.headers already sent
The calling file that gives me the error:
Code: Select all
<?php
include ("text2image-class.php");
$image = new Text2Image();
$image->Set_Text ( "print me" );
$image->Create_Image();
$image->Show_Image();
?>Code: Select all
function Show_Image()
{
header("Content-type: image/png"); //Set the header
imagePNG($this->Image); //Send the image to the browser
imageDestroy($this->Image); //throw away our canvas
}Why am I getting this error?:
Thanks,Warning: Cannot modify header information - headers already sent by
(output started at /<dir to website>/text2image-class.php:507) in
/<dir to website>/text2image-class.php on line 502
Paul