lingo5 Posted May 31, 2011 Share Posted May 31, 2011 Hi, I want to echo an image depending on a value. This is the code I'm using <?php if ($row_cliente_RS['estadofactura_titulo']) == 'yes' echo '<img src="img/pagada.jpg" width="70" height="15">'; ?> ...but nothing echoes. What am I doing wrong? Thanks Link to comment https://forums.phpfreaks.com/topic/238018-help-printing-an-image/ Share on other sites More sharing options...
xyph Posted May 31, 2011 Share Posted May 31, 2011 http://www.tizag.com/phpT/if.php Link to comment https://forums.phpfreaks.com/topic/238018-help-printing-an-image/#findComment-1223053 Share on other sites More sharing options...
HDFilmMaker2112 Posted May 31, 2011 Share Posted May 31, 2011 Hi, I want to echo an image depending on a value. This is the code I'm using <?php if ($row_cliente_RS['estadofactura_titulo']) == 'yes' echo '<img src="img/pagada.jpg" width="70" height="15">'; ?> ...but nothing echoes. What am I doing wrong? Thanks The closing ) in your if statement is in the wrong place: if ($row_cliente_RS['estadofactura_titulo'] == 'yes') and you should wrap the content for the if statement in {} brackets: <?php if ($row_cliente_RS['estadofactura_titulo']== 'yes'){ echo '<img src="img/pagada.jpg" width="70" height="15">'; } ?> Link to comment https://forums.phpfreaks.com/topic/238018-help-printing-an-image/#findComment-1223056 Share on other sites More sharing options...
lingo5 Posted May 31, 2011 Author Share Posted May 31, 2011 Thanks HDFilmmaker, that solved it. Thanks to you too Xyph, I will take a look at that. Link to comment https://forums.phpfreaks.com/topic/238018-help-printing-an-image/#findComment-1223059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.