我試圖運行託管在不同服務器上的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