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