Posted by Areric on 04/17/06 04:07
Hey all,
Another question for you.
I have a script that reads in a row from my db into an image object
which i defined. It then takes that image and generates a thumbnail by
using an output buffer and writes the thumbnail to a new entry in the
database. Finally it prints the new image to the screen via this
method:
header("Content-type: ".$image->GetFileType());
header("Content-length: ".$this->GetFileSize());
echo $this->GetImageContent();
where GetImageContent returns the binary data contained in the image.
This all seems to work, but when it hits the first header line
header("Content-type: ".$image->GetFileType());
it adds a second entry into the database. Basically im ending up with 2
identical records.
Ive been trying to figure out how to work around this, and the only
thing i could think of was that because im calling to header the script
is getting executed twice. No where in my print function so i have a
call to save so my question i suppose is, is it possible for a script
to execute a second time because of a call to header?
[Back to original message]
|