phpjayx Posted December 22, 2012 Share Posted December 22, 2012 I'm new to this stuff, so I'm sure its something simple.... I'm attempting to load in a default picture if one from the database isn't defined Its not working, is there anything I'm doing incorrect here? Thanks in advance --------------------------- <script type="text/javascript" src="jquery-1.8.2.js"> if(<?php echo $picture?>!=""){ <img id="img_background"src="<?php echo $picture?>" /> else <img id="img_background"src="LogoColorTextBelow.png" /> } Link to comment https://forums.phpfreaks.com/topic/272279-simple-if-statement-in-html-java/ Share on other sites More sharing options...
phpjayx Posted December 22, 2012 Author Share Posted December 22, 2012 I figured it out..................... <?php if($picture!="") : ?> <img id="img_background"src="<?php echo $picture?>" /> <?php else : ?> <img id="img_background"src="LogoColorTextBelow.png" /> <?php endif; ?> Link to comment https://forums.phpfreaks.com/topic/272279-simple-if-statement-in-html-java/#findComment-1400861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.