PHP 5 - Using an external URL with the function include

Last update on January 12, 2009 05:20 AM by deri58
Published by deri58

PHP 5 - Using an external URL with the function include






The option to include an external URL (ie absolute, in the form http://site.tld/url) with the function include is disabled by default from PHP 5 and latest version. Below is the two commands to include in php.ini to activate same:

allow_url_include = 1
allow_url_fopen = 1


For more information, go to: http://www.php.net/ ... # ini.allow-url-fopen

Note: Activating the option allow_url_include in PHP may be fatal for its security flaws if the PHP developer is negligent

An example, if you have a PHP script which includes a page based on what we give as arguments via the URL.
This means that typing http://votresite.flet/mapage.php?page=page_a_inclure.php you include the "page_a_inclure.php.

If your code looks like this: include $ _GET ['page'], so you leave the door open for anyone to add external code. Indeed, nothing prevents me to include a php page.
Best answers for « PHP 5 Using an external URL with the function include » in :
[PHP5] Using an external URL with the include function Show [PHP5] Using an external URL with the include function Normally the option to include external URL (e.g absolute, shape http://site.tld/url) via the function include is disabled by default in php5 versions, to activate this option on...
Notice: Undefined index ShowNotice: Undefined index It may happen when trying to recover variables from your forms, below error message appears on your screen: If you use the $ _POST or $ _GET variables to recover your forms or otherwise, you may come across...
How to turn a URL into a hyperlink ShowHow to turn a URL into a hyperlink If you are using PHP, there is a simple way to turn a URL into a hyperlink when inserting the address into your PHP document. This process is mostly used to ease the users' search of external websites or...
[PHP] mail function() Show[PHP] mail function() The mail function() is blocked by most free hosts for security reasons (avoid spamming), the IP address of the machine which requested the script will be indicated in the header 'X-MM - Mail-From-IP. The syntax is:...
URL ShowWhat is a URL? A URL (Uniform Resource Locator) is a universal naming format used to indicate a resource on the Internet. It is a printable ASCII character string which breaks down into five parts: The name of the protocol: i.e. in a way the...
Hyperlinks ShowIntroduction to anchors Hypertext links or hyperlinks (anchors) are HTML elements that, when clicked on, enable readers to visit a new address. Hyperlinked text is underlined by default. Hyperlinks are what connect web pages to one another. They...
Declaring a style sheet (CSS) ShowDeclaring a style sheet Style sheets are not directly integrated into the W3C's HTML recommendations. For this reason, you need to include elements in the HTML code indicating both the type of document, meaning the version of the HTML and CSS...