vijdev Posted August 10, 2010 Share Posted August 10, 2010 how to display a lengthy form...20 lines of HTML, only if a particular condition is met? should i use if (condition==true) { $form=<<<startForm /HEREDOC HTML for form startForm; echo $form; } else { no html } is this a good way? Link to comment https://forums.phpfreaks.com/topic/210361-display-form-only-if-condition-met/ Share on other sites More sharing options...
sinista Posted August 10, 2010 Share Posted August 10, 2010 I guess so if it was me I would write the form out of the PHP tags (I find it easier to debug) <?php if(1==1) { ?> <form name = "form1" action="?" method="get"> <!-- form stuff --> </form> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/210361-display-form-only-if-condition-met/#findComment-1097726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.