Using php to check whether or not to display html code.

I’ve got this snippet and I’m not sure why it isn’t working, if anyone can point me in the right direction whether its a tutorial or a fixed version of the snippet I’d really appreciate it.

[php]<?php if (1 == 2) { ?>











<?php } ?>[/php]

Thanks for your time.

That is an odd way to enclose a form. It is saying if 1 equals 2 which will never be true .

== is a comparison operator.

I would tell you to look at PHP templating engines like Smarty and Twig. PHP should no longer be embedded with HTML like this.

Sponsor our Newsletter | Privacy Policy | Terms of Service