Jump to content


Photo

inserting variable into tag?


  • Please log in to reply
2 replies to this topic

#1 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 25 June 2006 - 12:46 PM

hi,

i want to insert a variable into html tag how?
this is my previous attempt

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

I guess the src=$filename is wrong.
What is the right way to insert a variable inside a html tag?

thanks in advance

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 25 June 2006 - 12:51 PM

That is fine. Why do you think it's incorrect?

Ken

#3 lisa

lisa
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationNew Hampshire

Posted 25 June 2006 - 12:53 PM

I'm new to PHP so I could be wrong about this ....but I'm pretty sure that the extension on your html file has to be .php. If you leave it as .html it's not going to work.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users