I'm having kind of controller http://samplesite.com/application/getimage written in php. It is a simple script that responds to GET with some parameters. According to these parameters I find an image in database (image is stored there as a BLOB) and I return it as follows:
header("Content-type: image/jpeg");
echo $image;
$image
is a BLOB of image obtained from database.
When I open this URL http://samplesite.com/application/getimage/?id=200 my web browser displays an image.
Now I want to display this image inside a table in another php script. I want to perform it like
echo "<img src="http://mysite.com/application/getimage/?id=200" ...some params here... />";
but this approach does not work. It displays no image or makes other problems.
What approach should I choose to make this work? I'm new to php normally work with Java EE. Thanks very much.
EDIT: Of course there should be inside the echo \" and not only ". But this approach that I wrote here works fine. Problem was in syntax, I had one extra ).