Php Include from another domain

Possible duplicate:
including php file from another server with php

<?php include('http://www.staticimages.co/legal-documents/fonts.php');?> 

I am trying to centralize a file that I will include in several different domains. I have a place, but I'm not sure how to include the file. I tried above (this is the correct url), but I am getting the following errors:

Warning: include () [function.include]: http: // the shell is disabled in the server configuration allow_url_include = 0 in C: \ wamp \ www \ flirtwithme.co \ includes \ legal \ dating-safety-tips.php on line 15

Is there a preferred way to do this? Maybe CURL?

THX

+7
source share
3 answers

Do not do this at run time - this is terrible for security (PHP code must be passed in clear text to enable) and performance (an HTTP call will take a long time, and if the remote server is down or unavailable, your script will shut down).

If you need to get content from a remote location, consider using a cron job that will receive data at regular intervals, or maybe better - an active "push" solution using FTP, for example, updating a file in several places when it is updated .

To set cron, you really need to use curl (if it is installed), since your provider denies access to http: // URLs from file functions.

+10
source

If you know the security implications, you can enable remote inclusion by setting the following in php.ini :

 allow_url_include = On 
+3
source

You can CURL delete the script and then eval ().

+2
source

All Articles