PHP spits actual HTML instead of image -


having small issue here cannot figure out have gone wrong. have following code should show image depending on condition instead shows html in browser

if ($this->id_status  == 2)     {             $this->id_status  = "<img src='../_lib/img/gray_dot.png' />";     } elseif ($this->id_status  == 1)     {             $this->id_status  = "<img src='../_lib/img/green_dot.png' />";     } elseif ($this->id_status  == 3)     {             $this->id_status  = "<img src='../_lib/img/orange_dot.png' />";     } 

can help?

try this:

<?php      if ($this->id_status  == 2)         {    ?> <img src='../_lib/img/gray_dot.png' /> <?php         }     elseif ($this->id_status  == 1)         { ?>                <img src='../_lib/img/green_dot.png' /> <?php          }     elseif ($this->id_status  == 3)         { ?> <img src='../_lib/img/orange_dot.png' /> <?php          } ?> 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -