Loading...

Knowledge Base

Why can't I include a remote php file (i.e., include "http://domain.com/file.php")?

Both including a PHP file and the ability to include a PHP file could have very high security risks for your site and the entire server. A hacker who gains access to your account through improper coding is going to have a much easier time executing code on the system if he/she is allowed to include remote files.

In most cases, the reason you are including a remote file is to have the content show up on your web page. If that is the case, then you will be able to use the following function and still maintain the security of your website in regards to including remote php files:
 

  • echo ( file_get_contents( "http://domain.com/file.php") );
Did you find this article helpful?

 
* Your feedback is too short

Loading...