Hi,
I get the data from another site via xml format no database.
How to connect to that site and get the data(request and response type of xml).
Anybody know how to do this.
Thanking You.
XMLRPC
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Swami says: file_get_contents()
-
my_raj_raj2
- Forum Commoner
- Posts: 28
- Joined: Mon Mar 20, 2006 8:06 am
- Location: India
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Then it's either fsockopen() or cURL.
-
my_raj_raj2
- Forum Commoner
- Posts: 28
- Joined: Mon Mar 20, 2006 8:06 am
- Location: India
when i search in web I found this coding
I run this coding but i got following error
Why it is appear?
Help me
Code: Select all
<html>
<head>
<title>XML-RPC PHP Demo</title>
</head>
<body>
<h1>XML-RPC PHP Demo</h1>
<?php
include 'xmlrpc.inc';
// Make an object to represent our server.
$server = new xmlrpc_client('/api/sample.php',
'xmlrpc-c.sourceforge.net', 80);
// Send a message to the server.
$message = new xmlrpcmsg('sample.sumAndDifference',
array(new xmlrpcval(5, 'int'),
new xmlrpcval(3, 'int')));
$result = $server->send($message);
// Process the response.
if (!$result) {
print "<p>Could not connect to HTTP server.</p>";
} elseif ($result->faultCode()) {
print "<p>XML-RPC Fault #" . $result->faultCode() . ": " .
$result->faultString();
} else {
$struct = $result->value();
$sumval = $struct->structmem('sum');
$sum = $sumval->scalarval();
$differenceval = $struct->structmem('difference');
$difference = $differenceval->scalarval();
print "<p>Sum: " . htmlentities($sum) .
", Difference: " . htmlentities($difference) . "</p>";
}
?>
</body></html>Code: Select all
Fatal error: Class 'xmlrpc_client' not found in C:\AppServ\www\rpc\test1.php on line 12Help me
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
There error says it doesn't exist. Why that is, I can't say. I'm not psychic. Psychotic, maybe, but definitely not psychic.
And please use the highlighting functionality we have provided:
And please use the highlighting functionality we have provided:
Code: Select all
for instance..