我试图运行托管在不同服务器上的php函数。下面是相关的代码:php包含来自不同服务器的文件
在firstdomain.com/handler.php:
include 'http://www.seconddomain.com/functions.php';
$disp_keyword = doQuery(0, $keyword, null);
而且在seconddomain.com/functions.php:
function doQuery($code, $arg1, $arg2) {
mail('[email protected]', 'doquery entered', 'test');
}
我怎样才能得到这个工作?
您必须确保'allow_url_fopen'已启用并且'allow_url_include'也是如此。同时使_absolutely_确定您知道您远程包含的文件的内容,并且100%可信。 – 2012-04-29 02:21:54
见http://www.php.net/manual/en/features.remote-files.php和http://www.php.net/manual/en/function.include.php – 2012-04-29 02:22:31