• 0

bcvb


Question

3 answers to this question

Recommended Posts

  • 0

http://ca.php.net/include/

If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix L for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

This means u can't include a remote file using an URL and expect the PHP variables to be seen by your script.

The PHP file is executed on the remote server, and only the output (echo "xyz") will be included in your aaa.php

In this case, conf_global.php doesn't output anything, so nothing is included.

Example:

conf_global.php

<?php

echo "Something from included file ...";

?>

aaa.php

Result: a page that shows "Something from included file ..."

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.