Include files from different servers using php

0

How to include different files from different servers using PHP? Is this possible easily? Read this to know about this fully.

Many hosting companies preventing php access to outside files.So you can not use the include to include the files from a remote address for security reasons.

If you use normal file including script as follows,

then will displaying errors;
"Warning: include() [function.include]: URL file-access is disabled in the server configuration in www.mydomain.com/template.php on line......" or failed to open stream: Permission denied in....

If you want to include remote files, you must enable allow_url_include setting in the php.ini file.You can do it by adding following line into your page.But this is a bad habit. 😀

If you want to read the contents of a remote file though, you can use the file_get_contents function.But there are no any server side scripts like php. Because it is pure HTML markup code.

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.