I have a file called t.php:
<html>
<body>
<?php
require "http://localhost/~derek/l.php";
rp(3);
?>
</body>
</html>
and l.php:
<?php
echo "define function...";
function rp( $num )
{
echo "rp: $num";
}
echo "defined";
?>
When I load t.php into my browser it prints "define function...defi ned
Fatal error: Call to undefined function: rp()
in /home/derek/public_html/t.php on line 6"
So, I know the library code is being loaded and executed (because the
strings are echoed) but rp() isn't being defined. Experimentation shows
it's not just functions which I'm not getting defined, as I get the same
sort of error if I just define a variable and try to get it printed in
t.php.
Can someone tell me what I'm doing wrong? I'm using PHP-4.3.4 on SUSE
LINUX-9.1.
<html>
<body>
<?php
require "http://localhost/~derek/l.php";
rp(3);
?>
</body>
</html>
and l.php:
<?php
echo "define function...";
function rp( $num )
{
echo "rp: $num";
}
echo "defined";
?>
When I load t.php into my browser it prints "define function...defi ned
Fatal error: Call to undefined function: rp()
in /home/derek/public_html/t.php on line 6"
So, I know the library code is being loaded and executed (because the
strings are echoed) but rp() isn't being defined. Experimentation shows
it's not just functions which I'm not getting defined, as I get the same
sort of error if I just define a variable and try to get it printed in
t.php.
Can someone tell me what I'm doing wrong? I'm using PHP-4.3.4 on SUSE
LINUX-9.1.
Comment