Display image from php url

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Display image from php url

w77r
Hi,
I'm using image.php file to generate images from database BLOB.
Image url looks like this: <a href=img.php?idprod=1&pic=1" rel="shadowbox[Mixed]">
of course shadowbox doesn't display any image generated by php. So, how to handle that kind of image displaying ?
regards
w
Reply | Threaded
Open this post in threaded view
|

Re: Display image from php url

manfer
I think those kind of things are normally done on the server, not the way your code does. I mean you would have a template to display products or whatever and you send the parameters to that template, product.php?idprod=1. And that generates the needed html which is the one sended to the browser. So effectively the user in the browser is going to see:

<a href="pic_idprod_1.jpg" rel="shadowbox[Mixed]">

But if you do it that other way with the href property value being a php script that returns an image, it will work too. The only difference is that the automatic shadowbox player detection is going to detect it as an external page, iframe, so it is not going to work as expected with an image. To solve it you have to instruct yourself to shadowbox it is an image and that you want to use the image player:

<a href="image.php?idprod=1&pic=1" rel="shadowbox[Mixed]; player=img">Product</a>