I have a database that contains image filenames, among other fields. I have pulled the data into a structure (dataStruct) so that I can more easily display it in a dynamically created table. I am trying to display the actual images in the page, rather than just the filenames, using the following code:
<cfif dataStruct.photo is "">
<cfset dataStruct.photo = "No Photo Available">
<cfelse>
<cfset dataStruct.photo = "<img height='50' width='50' src='productphotos/" & trim(dataStruct.photo) & "'>">
</cfif>
However, the output does not display the image or even a broken link, it is just blank. Though if I look at the source code for the output I see the following:
<td><img height='50' width='50' src='productphotos/151-238.jpg'></td>
Can someone help me figure out what is going on here?
<cfif dataStruct.photo is "">
<cfset dataStruct.photo = "No Photo Available">
<cfelse>
<cfset dataStruct.photo = "<img height='50' width='50' src='productphotos/" & trim(dataStruct.photo) & "'>">
</cfif>
However, the output does not display the image or even a broken link, it is just blank. Though if I look at the source code for the output I see the following:
<td><img height='50' width='50' src='productphotos/151-238.jpg'></td>
Can someone help me figure out what is going on here?