Jump to content

Help printing an image


lingo5

Recommended Posts

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">';
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.