Hello all,
I stumbled over a class of problems that appeares rather difficult to me. Here's the situation:
I'm developing a vectorbased 3d drawing libary using PHP and GD. The vectors are stored in sessions along with information about image size, colors and so on.
Now I have two flavors of the same problem:
To draw the picture I have to call a function that takes the session data, does with it whatever needs to be done and then generates a png-file inside DOCUMENT_ROOT. Thus I need a webserver-writable directory which certainly is not what I want.
I know that PHP can send images directly by setting the header to content-type: image/png or similar. But if I do this I can no longer access the sessiondata because that needs header information as well.
See the problem? I either get the data to draw the picture but can not send the pic to the user or I send an empty pic...
The second flavor appears when I want to send a datadump via session_encode() to the user (textfile similar to the popular sql-dump in phpMyAdmin).
I either send an empty textfile because I can not access the sessions' content or i can not send at all but have all info.
Long explanation, short problem: Can I access the sessions' content, keep it and then still be able to send a new header such as image/png or text/plain to send a picture or a textfile?
Thanks in advance,
Dominique