dalecosp;10967522 wrote:Dunno if it's a newb question. It's a question of scope. Can we see the variable declaration from "engine_client.php"?
As requested, here's the variable declaration from engine_client.php;
function callEngine($method, $args = NULL)
{
global $engine_xmlrpc_address;
// print("$method\n");
list($success, $response) = XMLRPC_request($engine_xmlrpc_address, '/RPC2', $method, $args);
if ($success)
{
if (is_array($response))
{
printf("%s returned: ", $method);
print_r($response);
}
else
{
printf("%s returned: %s\n", $method, $response);
}
}
else
{
echo($response['faultString']);
exit;
}
return $response;
}
And as for
bradgrafelman;10967593 wrote:Global variables from the calling script are accessible in the called script, though that's a bit messy (i.e. there's a link between the two .php files that you can't actually see/define very well). As such, there are usually better ways of doing it, e.g. wrapping the functionality in a custom function or class.
...I'm sorry, what now?! I'm not a complete n00b but still learning the ropes!
From what I understand about what you were saying, a variable in my script doing the
require_once("engine_client.php");
can be read in the script being called, in this case engine_client.php?
That's great to know, but I need it the other way around, so that the variable set in engine_client.php (see above code for variable declaration) can be called in the script doing the
require_once("engine_client.php");
. Make sense?
Thanks for your help guys 🙂
Regards,
Dan