Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to display Image from database

Status
Not open for further replies.

Apache65

Technical User
Jan 30, 2006
16
I have a database that contains various information in it including a path/filename of an image. I have a cgi script that connects to the database and pulls in the data into a table of a template webpage. When the page is displayed, I get the info from the database as expected, however, what I really want to happen with the image is have it displayed – what I get is the path/filename. Is there a way to create an <img> tag that can be used with a variable that will display the image not the path?

The code for the template page is below…any help would be appreciated!

<TH align="center"><font color="#FFFFFF" face="Arial">Person ID</font></TH>
<TH align="center"><font color="#FFFFFF" face="Arial">Person Code</font></TH>
<TH align="center"><font color="#FFFFFF" face="Arial">First Name</font></TH>
<TH align="center"><font color="#FFFFFF" face="Arial">Last Name</font></TH>
<TH align="center"><font color="#FFFFFF" face="Arial">File Location</font></TH>
</TR>
<TMPL_LOOP NAME="ROWS">
<TR class="<tmpl_var class>">
<TD><b><font color="#000066"><TMPL_VAR NAME="PERSON_ID"></font></b></TD>
<TD><b><font color="#000066"><TMPL_VAR NAME="PERSON_CODE"></font></b></TD>
<TD><b><font color="#000066"><TMPL_VAR NAME="PERSON_First_Name"></font></b></TD>
<TD><b><font color="#000066"><TMPL_VAR NAME="PERSON_Last_Name"></font></b></TD>
<TD><b><font color="#000066"><TMPL_VAR NAME="Photograph_File_Name_Path"></font></b></TD>
</TR>
</TMPL_LOOP>
</TABLE></td>
</tr>
</table>

</CENTER></BODY></HTML>
 
Why not something like:
Code:
...
<TD><b><font color="#000066">[COLOR=blue]<img src="[/color]<TMPL_VAR NAME="Photograph_File_Name_Path">[COLOR=blue]">[/color]</font></b></TD>
...

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thanks for the reply - that worked great................
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top