oni-kun Posted December 12, 2009 Share Posted December 12, 2009 I'm trying to output some HTML based on if some post/get variables are set.. but I don't want to echo it. Can I do something such as.. <?php if (isset($_POST['whatever'])) { ?> <form>... <b> I'm HTML </b> </form>... <?php } else { ?> <b> I only appear in the else </b> <?php } ?> ? Will the html between the else statement only appear if it is else, and not appear since it's simply not in the PHP tags? I THINK I've seen some things like this before, but I just don't know, and don't want to copy all the html into the php and echo it.. Quote Link to comment https://forums.phpfreaks.com/topic/184875-do-i-need-php-tags-to-output-this/ Share on other sites More sharing options...
RussellReal Posted December 12, 2009 Share Posted December 12, 2009 Yes you can do that.. if the if statement is triggered than the php will terminate then output the data and then re-enter into php where it last stopped. Quote Link to comment https://forums.phpfreaks.com/topic/184875-do-i-need-php-tags-to-output-this/#findComment-975939 Share on other sites More sharing options...
oni-kun Posted December 12, 2009 Author Share Posted December 12, 2009 Thanks, This helps quite a few future problems out. Quote Link to comment https://forums.phpfreaks.com/topic/184875-do-i-need-php-tags-to-output-this/#findComment-975940 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.