How to reasonably nest php in html

Source: Internet
Author: User
If you want to nest php code in html, it is usually okay. But how do I write a Condition Statement in a condition statement? For example: {code...}. After determining whether a cookie exists, you also need to determine whether $ list exists. However, an error occurred while writing. I don't know what... I want to nest php code in html. Generally, it's okay. But how do I write a Condition Statement in a condition statement?

For example:


              

Download list

....

After determining whether a cookie exists, you also need to determine whether $ list exists. However, an error occurred while writing.

I don't know how to solve this problem?

Reply content:

If you want to nest php code in html, it is usually okay. But how do I write a Condition Statement in a condition statement?

For example:


              

Download list

....

After determining whether a cookie exists, you also need to determine whether $ list exists. However, an error occurred while writing.

I don't know how to solve this problem?

Please refer to the following link for more information: https://www.php1.cn/article/7279.html.

If you do not understand, write the entire php statement, and then use echo to input the html Tag. The tag folder is too dizzy.
Or use a template.

The landlord can look at alternative PHP syntax specification: http://php.net/manual/zh/control-structures.alternative-syntax.php

No error is reported when I run it.

If the alternative syntax doesn't work, replace it with the basic syntax ~


          

Download list

....

// But it will not be dizzy ....

I personally think that the cookie should be placed inLogic layerAnd should not be droppedDisplay Layer. In this way, the code structure will be very bad and will not be well maintained in the future.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.