呼叫包括远程功能 [英] calling included remote functions
问题描述
在一个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屋!