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" /> } Quote 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; ?> Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.