Jump to content

Do I need php tags to output this?..


oni-kun

Recommended Posts

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..

Link to comment
https://forums.phpfreaks.com/topic/184875-do-i-need-php-tags-to-output-this/
Share on other sites

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.