$img = "data:image/jpeg;base64,". base64_encode($data);
where in $data is stored the image created.
Now to avoid IE problems....i have see code that change the address of image show with javascript and replace it with a call to the same php file passing the image in a var _ddu
<img name="image" src="<?=$img?>">
<script language="Javascript"><!--
if (/Microsoft/.test(navigator.appName)) {
var img = document.captcha_image;
img.src = "$base?_ddu=" + img.src.substr(23);
} //--></script>
where $base is the address to the foto.php
foto.php
if (isset($REQUEST["ddu"]))
{
header("Content-Type: image/jpeg");
//die(base64_decode(substr($REQUEST["ddu"], 0)));
}
so in this way if browser is mozilla all is ok....if IE the you pass the image in variable ddu and show it with a call to the php transfering it with the right content type method.
The only problem is that for large varibales the value ddu is empty!