Can PHP include a config.php that is remote from the extranet? And get config inside the constant

Source: Internet
Author: User
Can PHP include a config.php that is remote from the extranet? And get config inside the constant

Reply content:

Can PHP include a config.php that is remote from the extranet? And get config inside the constant

If I could do it directly, the network would be really unsafe.

The include can contain remote, but the code of the remote config.php file must not be able to get it, because it will be parsed out, you can get only the content after parsing output. You might as well just curl up and pull the remote JSON file and parse it to get the value.

OK
Better with ReadFile ()
http://php.net/manual/zh/function.include.php

Good dangerous idea use API ideas

Are you afraid of being dark enough for you? It's too dangerous. Use the API or RPC-like scenarios.

To see if the remote server can parse PHP, if not, then the remote server will access the original content of the file, if so, the parsed HTML content is returned.

Contains remote files very unsafe recommended API

  • 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.