You should have a closer look at the concept of a function.
A function are suposed to return a value (with "return"),
not a script.
Try this in your main script:
$fu = bar();
echo "$fu<br>\n";
--[in your include file you need to have something likje this:]----
function bar()
$val = "simples";
return $val;
}
------------------------------------------------
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 2004-04-10 03:55
Subject: [PHP-WIN] Including remote PHP script, Return DO NOT works.
Hi All,
I don't know if this is the wanted situation...
If you include a full URL path to a file in your own server (or specify
a remote php script) that has a RETURN statment, the value is not return
from this script (remotely or locally with full URL path).
See example below:
simples.php 's code:
<?
$val = "simples";
return $val;
?>
-----------------------------------------------
main_1.php 's code:
<?
$resultado = include ("./simples.php");
print_r($resultado);
?>
-----------------------------------------------
main_2.php 's code:
<?
$resultado = include ("http://localhost/simples.php");
print_r($resultado);
?>
-----------------------------------------------
Running main_1.php (http://localhost/main_1.php) I got the following
output:
simples
Running main_2.php (http://localhost/main_2.php) I got the following
output instead of "simples" as before:
1
This is a normal situation?
If yes (or also if this is a bug), what could be done to return the
result of a remote script execution? There is another way to get the result
of a external execution?
I need this to external users be able to run SQL commands on my mysql
server without pass them my server password. I pretend to use a
username/password protection to do some users just access some tables...
There is something like that I can use?
Tahnks a lot,
Ricardo Jr.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php