I have an MS-SQL database that contains information about people--name, phone, address, ID, etc. I connect to it via a Win32::ODBC connection to return demographic information. Everything works, but the image display is sloppy and I don't like sloppy.
Images (jpgs) are stored in outside the SQL server in a separate folder on the webserver. (There is no OLE field available in the database to place link info.) They are named according the the person's ID. For example John Doe would have the ID "DOEJ" and his image file would be "DOEJ.jpg".The image link is built dynamically in my Perl script and inserted into the HTML display by concatenating the src link with the ID pulled from the data base. Unfortunately, not all the people have photos. The script builds the link and passes it to the browser which displays a broken image icon when there is no picture behind the seemingly legitimate link.
Ideally, I'd like to be able to catch the problem before the data is sent to the browser and substitute a "no picture available for this person" message or image for the broken image link. I'm uncertain of the best approach for this, so I'm tossing it out here for the creative minds of the monastery. How and where can I test to see if there's an image in the image folder before I build the link from the ID data?
WB
In reply to CGI-SQL-HTML-Display "no image" by WhiteBird
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |