[FX.php List] Displaying images

Bob Patin bob at patin.com
Mon Nov 3 08:56:54 MST 2008


Thomas,

At first glance I'm wondering about the way you've got your URL  
constructed; when I display images on the web, I prefer to mix my PHP  
rather than writing all the HTML inside PHP, but that's just me;  
here's how my code would look:

<?php

// some sort of query up here that retrieves the graphic's name or URL

$my_image = "image.gif";

?>

... in the HTML of the page:

<img src = "images/<?php echo $my_image; ?>">

If you're pulling up images of varying sizes, you can leave the  
dimensions out, which will allow the page to show the image with  
whatever its demensions are; if you want all of them to show up with  
the same width, you can specify just a width parameter, like this:

<img src = "images/<?php echo $my_image; ?>" width="125">

More than you asked, probably things you already knew, but just in  
case... :)

Best,

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
AIM: longterm1954
FileMaker 9 Certified Developer
Associate Member of FileMaker Business Alliance
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting



On Nov 1, 2008, at 5:01 AM, Thomas Neumann wrote:

> Hi All,
>
> I'm facing the following problem
>
> I try to display images from a database in a webpage using FX.
> When I just use img src= \" $data["picture] \" then it works (after  
> a request for the password) on my development pc, where FMServer and  
> the webserver run on the same machine. But when I put it on the  
> server (filemakerserver and webserver on different machines) then it  
> does not work (it even did not ask for the password).
> I tried the image_prox.php from the FX demo, but could not get it  
> working in any configuration.
>
> Any hints or clues?
>
> Tomy
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20081103/1a7bfa9d/attachment-0001.html


More information about the FX.php_List mailing list