Getstatename demo

Send a U.S. state number to the server and get back the state name

The code demonstrates usage of the php_xmlrpc_encode function

Sending the following request:\n\n" . htmlentities($f->serialize()) . "\n\nDebug info of server data follows...\n\n"; $c=new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80); $c->setDebug(1); $r=&$c->send($f); if(!$r->faultCode()) { $v=$r->value(); print "
State number " . $stateno . " is " . htmlspecialchars($v->scalarval()) . "
"; // print "
I got this value back
" .
            //  htmlentities($r->serialize()). "

\n"; } else { print "An error occurred: "; print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'
"; } } else { $stateno = ""; } print "

Enter a state number to query its name

"; ?>
$Id$