XML-RPC Server Side Code Problem...
Posted: Sat Aug 09, 2008 6:30 pm
Hi,
I've been working on an XML-RPC server & client just for the fun of it. Well, I wanted to write an IP check function where the server retrives the IP forwarded by the client... Well, it turns out its being more of a problem that I had thought to put in effect.
Heres the server code:
<?php
function server_checkip($method_name,$params,$app_data)
{
$IP = $params[0];
If ($IP == "127.0.0.1")
{
return "$IP has been allowed by the server!";
} else {
return "$IP has been denied by the server!";
}
}
?>
And... Heres the client code!
<?php
$IP = $REMOTE_ADDR;
$results = xu_rpc_http_concise(
array(
'method' => "ipcheck",
'args' => array($IP),
'host' => $host,
'uri' => $uri,
'port' => 80
)
);
print $results;
?>
Can anyone tell me what I'm doing wrong, and an code example of what I need to do, to get this working?
Much Appreciated,
Aric Holland
I've been working on an XML-RPC server & client just for the fun of it. Well, I wanted to write an IP check function where the server retrives the IP forwarded by the client... Well, it turns out its being more of a problem that I had thought to put in effect.
Heres the server code:
<?php
function server_checkip($method_name,$params,$app_data)
{
$IP = $params[0];
If ($IP == "127.0.0.1")
{
return "$IP has been allowed by the server!";
} else {
return "$IP has been denied by the server!";
}
}
?>
And... Heres the client code!
<?php
$IP = $REMOTE_ADDR;
$results = xu_rpc_http_concise(
array(
'method' => "ipcheck",
'args' => array($IP),
'host' => $host,
'uri' => $uri,
'port' => 80
)
);
print $results;
?>
Can anyone tell me what I'm doing wrong, and an code example of what I need to do, to get this working?
Much Appreciated,
Aric Holland