| |||||||||||
| |||||||||||
Blob Images with Functions Posted by mr_yogi (mr_yogi), 23 October 2006 Hi,I'm trying to keep my Web application down to 4 files (HTML Template, Main PHP, Web Helpers and Bus Logic) however I'm running into problems with images stored in MySQL Blobs. I thought it would be neat to keep all my images (logos etc.) in MySQL blobs. I can add and select/ view the images by using separate programs. I have removed my application and created a test example: test1.php Code:
with showImage.php Code:
Works fine. However when I try and make showImage a function rather than a separate file I get the binary string output in the HTML. test2.php Code:
Any ideas what I'm doing wrong? I haven't been able to find a great deal online about this stuff, mostly people creating thumnails. I have tried various ways to call the function (some are rem'd out in the above code). Thanks Kristin Posted by admin (Graham Ellis), 23 October 2006 With a function call, you're trying to include the binary stream for an image within the HTML, and that's not how it works, I'm afraid ![]() Now ... I HAVE written a piece of code that included both the image generation and the HTML in the same page and it sent out either an image/jpeg or a text/html depending on what paramaters were passed in. But I do NOT recommend you do so; in hindsight, it was a very poor design - I think they call it "job protection code"! Posted by mr_yogi (mr_yogi), 23 October 2006 Thanks ![]() This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |