php include () _php tutorial with parameter implementation method

Source: Internet
Author: User
Inlcude with parameters This problem before I did not succeed, today saw an article decisively made, as I can so include (\ ' a.php?site=www.bkjia.c0m\ ') and then call a.php page can directly $_get[\ ' a\ ';

Detailed method


Example: Suppose you need to call Inc.php?para=3 in index.php,

inc.php

The code is as follows Copy Code

The following wording is not able to get the correct result:

index.php

The code is as follows Copy Code

With a little flexibility, the $_get variable is defined before include, and it works fine:
index.php

The code is as follows Copy Code

If the Allow_url_include feature is turned on in php.ini, you can use the Include URL:
index.php

The code is as follows Copy Code

To set the method: PHP.ini, locate the following line and change to on:

; Whether to allow Include/require to open URLs (like http:/or ftp://) as files.
Allow_url_include = On

However, to ensure security, most servers turn off the Allow_url_include feature, which can only be determined by the situation.

http://www.bkjia.com/PHPjc/628731.html www.bkjia.com true http://www.bkjia.com/PHPjc/628731.html techarticle inlcude with parameters This problem before I did not succeed, today saw an article decisive, such as I can so include (\ ' A.php?site=www.111cn.net\ ') and then in the call a.php page can be directly $_g ...

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