I have a problem with generating and exporting image with PHP.
So I have this:
header('Content-type: image/jpeg');
header('Content-Disposition: inline; filename=WHATEVER.jpg');
$dragon = self::static_dragon($numbers,$avatars,$new_name,$filepath);
Inside of static_dragon function I load data from database, work with them, etc and then:
imagejpeg($canvas,'',60);
imagedestroy($canvas);
return true;
What I want to achieve is that if I write <img src="http://www.example.com/dragon.php&width=100&height=100" /> it will give me the image. Everything works fine, database connection, even saving the final jpg file on server, only problem is that browser doesn't show me the image. I think maybe some problem in headers? Incidentally, I cannot execute the headers after the function as script tells me that headers were already sent (even though I don't see any command which would do so).
<?phpor anything?