Reformat source code: demos
[plcapi.git] / demo / client / zopetest.php
1 <html>
2 <head><title>xmlrpc</title></head>
3 <body>
4 <h1>Zope test demo</h1>
5
6 <h3>The code demonstrates usage of basic authentication to connect to the server</h3>
7 <?php
8 include "xmlrpc.inc";
9
10 $f = new xmlrpcmsg('document_src', array());
11 $c = new xmlrpc_client("/index_html", "pingu.heddley.com", 9080);
12 $c->setCredentials("username", "password");
13 $c->setDebug(2);
14 $r = $c->send($f);
15 if (!$r->faultCode()) {
16     $v = $r->value();
17     print "I received:" . htmlspecialchars($v->scalarval()) . "<br/>";
18     print "<hr/>I got this value back<br/>pre>" .
19         htmlentities($r->serialize()) . "</pre>\n";
20 } else {
21     print "An error occurred: ";
22     print "Code: " . htmlspecialchars($r->faultCode())
23         . " Reason: '" . ($r->faultString()) . "'<br/>";
24 }
25 ?>
26 </body>
27 </html>