PHP file require introduction considerations

Source: Internet
Author: User
If the PHP statement is placed in an HTML file, it will not be processed. However, if you use the Require () statement to load the HTML file, any PHP commands within the file will be called. Therefore, you can use any extension to name the include file, but it is a good idea to follow a convention, such as naming the extension. inc or. php.

If you do not use the. php extension name, you need to place the file to be introduced outside the document tree to prevent users from viewing the source code as text when they are loaded directly into the browser.

If the extension is. php, but contains only a subset of pages or scripts, this can cause errors.

Note: Regardless of which extension is used, the PHP code in the file to be introduced must be placed between PHP tags, otherwise the code will be treated as text or HTML script and therefore will not be executed.

The above introduces the PHP file require introduction considerations, including the require,php file aspects, I hope that the PHP tutorial interested in a friend to help.

  • Related Article

    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.