January 27, 200521 yr Simple question and hopefully simple answer: In PHP what is the code to display an image from a container field? Ie) in CDML: <img src="[FMP-Image:CoverImage]"> In PHP using FM5/6 you can use: <img src="http://localhost:591/FMPro?-db=publcations.fp5&-recid=<?php echo $recid; ?>&Coverimage=&-img"> But that won't work in FM7 In FX.php there appears to be a convoluted way to do it in a secure way. But all I want to know is the very basic simple was to do it using PHP code. Who can answer this?
January 29, 200521 yr Newbies There really isn't a very simple basic way to do it. The image proxy stuff in FX.php is really the best way to go.
January 31, 200521 yr Author I am new to PHP and still getting my head around the new codes, but is this a Filemaker structural problem. I wonder if MySQL or Oracle is better at interacting with PHP and images. From what I have been reading I am lead to believe that PHP does not present a good way to get images from a database. In filemaker 7, is there a way to get the image from the container field similar to fm5/6 ie) FM5/6 code = <img src="http://localhost:591/FMPro?-db=publcations.fp5&-recid=<?php echo $recid; ?>&Coverimage=&-img"> FM7 code = (maybe something using xml?)
January 31, 200521 yr Re: <img src="http://localhost:591/FMPro?-db=publcations.fp5&-recid=<?php echo $recid; ?>&Coverimage=&-img"> That is CDML. FM7 does not do CDML! This is what the FX php method looks like: <img src="/FX/image_proxy.php?FXimage=<?php echo vignereEncryptURL($PatientInfo['data'][$Patkey[0]]['thumbnail'][0]); ?>"> All the best. Garry
February 1, 200521 yr Author Thanks Gary, At this point you really have to appreciate the simplicity of CDML. The image_proxy.php method seems so cumbersome - but should work. Someone should simplify the class and do away with the encryption key. A great function that looks like: <img scr="<?php getimage($dbasename, $fieldname); ?>"> I know it doesn't exist, but how tough could it be to write one?
Create an account or sign in to comment