frshjb373 Posted August 11, 2012 Share Posted August 11, 2012 Can't seem to get this code right. Actually, I'm not even sure if you can place PHP tags within another PHP tag. If anyone has any advice, it would be much appreciated! <?php if (isset($image)) { echo "<img src=\"images/gallery-photos/<?php echo $image; ?>\" border=0>"; } elseif (!isset($image)) { } echo "<img src=\"images/contact-01.png\" border=0>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/266950-coding-help-ifelseif-statement/ Share on other sites More sharing options...
jiveturkey420 Posted August 11, 2012 Share Posted August 11, 2012 Don't put the <?php ?> tags in there. You can remove them, and the echo. You'd want it to look like this I believe.... <?php if (isset($image)) { echo "<img src=\"images/gallery-photos/$image\" border=0>"; } elseif (!isset($image)) { } echo "<img src=\"images/contact-01.png\" border=0>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/266950-coding-help-ifelseif-statement/#findComment-1368621 Share on other sites More sharing options...
frshjb373 Posted August 11, 2012 Author Share Posted August 11, 2012 Duh! I'm a bonehead. Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/266950-coding-help-ifelseif-statement/#findComment-1368624 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.