呼叫包括远程功能 [英] calling included remote functions

查看:89
本文介绍了呼叫包括远程功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个centraldomain.com,我有central.php,其中包括:

<?php

函数平方($ num)

{return $ num * $ num;

}

?>


在outerdomain.com,我有test.php,其中包括:

<?php

包括http://www.centraldomain.com/central.php" ;;

echo square(4); //输出''16''。

?>


outerdomain.com/test.php =

"致命错误:调用未定义的函数:square()in blah / blah / test.php

第12行


wha''appen''?我以为你可以调用包含的功能?嗯...如果我在outerdomain.com上放了

central.php,那就行了。没有远程包含

文件的调用函数?


-

juglesh

解决方案

num)

{return


num *


num;

}

?>


在outerdomain.com,我有test.php,其中包括:

<?php

包括http://www.centraldomain.com/central.php" ;;

回声方(4); //输出''16''。

?>


outerdomain.com/test.php =

"致命错误:调用未定义的函数:square()in blah / blah / test.php

第12行


wha''appen''?我以为你可以调用包含的功能?嗯...如果我在outerdomain.com上放了

central.php,那就行了。没有远程包含

文件的调用函数?


-

juglesh


at one centraldomain.com, I have central.php, which consists of this:
<?php
function square($num)
{ return $num * $num;
}
?>

at outerdomain.com, I have test.php, which consists of this:
<?php
include "http://www.centraldomain.com/central.php";
echo square(4); // outputs ''16''.
?>

outerdomain.com/test.php =
"Fatal error: Call to undefined function: square() in blah/blah/test.php on
line 12"

wha''appen''? I thought you could call included functions? Hmm... if I put
central.php on the outerdomain.com, it works. No calling functions from
files included remotely?

--
juglesh


解决方案

num)
{ return


num *


num;
}
?>

at outerdomain.com, I have test.php, which consists of this:
<?php
include "http://www.centraldomain.com/central.php";
echo square(4); // outputs ''16''.
?>

outerdomain.com/test.php =
"Fatal error: Call to undefined function: square() in blah/blah/test.php on
line 12"

wha''appen''? I thought you could call included functions? Hmm... if I put
central.php on the outerdomain.com, it works. No calling functions from
files included remotely?

--
juglesh



这篇关于呼叫包括远程功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆