开发者

How to use remote function in different server

Im trying to use function t开发者_开发知识库hat i put in remote server

Now in testing stage, im doing this in my local server (MAMP)

I already enabled allow_url_fopen and allow_url_include in php.ini file

in remote.php (in remote server), i have this code for testing :

function test(){
echo 'testing calling remote function';
}

and in my local server, i have this code :

require_once('http://remoteserver.com/remote.php')

test(); // calling test function in remote.php

but all i got is error call to undefined function

am i doing this in right way or wrong way ?

is there any way to do this ?


When you do require_once('http://remoteserver.com/remote.php'), the content you included is the output of http://remoteserver.com/remote.php, not the php source of this script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜