I apologize in advance since this is not Cake specific but came up in
our cake app. It probably is basic but I could sure use a pointer.
I implemented some code for captcha type things like so in a view:
<?php
$im = imagecreate(500, 150);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
$font = imageloadfont('blahblah');
imagestring($im, $font, 0, 0, "HELPME!", $textcolor);
header("Content-type: image/png");
imagepng($im);
?>
It works perfectly in a standalone php file outside cake. It also
works in a view if it is the ONLY thing in the view and I disable the
layout. If anything else is in the view before this bit, the browser
emits PNG data instead of an image -- what is my problem? I am sure it
is my misunderstanding of how browsers interpret mimes and data. Any
emissions before mess it up, and any emissions after it are not seen
(I guess the browser thinks its part of a png?)
I really want to be able to emit these bits on the fly and this has to
be easy.
My "workaround" has been to let imagepgn create a tmp file and I show
it with $html->image()
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---