Author Topic: tmpl_var with src-tag  (Read 801 times)

0 Members and 1 Guest are viewing this topic.

Frank

  • Guest
tmpl_var with src-tag
on: Mon, 02. September 2002 - 11:57:55
Hi,
i've got the name of an image in my mysql database.
I want to use this with tmpl_var name=bild in the scr-tag like this:

<img src="<tmpl_var name='bild'>  width="251" height="357" border="0" alt="">

This is, i think, not the wright synthax?????

Bye

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
tmpl_var with src-tag
Reply #1 on: Mon, 02. September 2002 - 12:51:37
For information:
Frank wrote me a mail, too.

I will answer here.

Your template should look like:

<img src="<tmpl_var name='bild'>" width="251" height="357" border="0" alt="">

and your PHP-script like this:

$tmpl->setVar(bild, "http://url/bild.gif");

---

You forgot the " in your src="

and I would not use
alt=""
if it's empty.

Note: If you use Frontpage or Dreamweaver I would use
{tmpl_var name='bild'}

Best regards,
Claus