Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

PHP<->XML-RPC Tutorial

Seidr Giha
Registered User
Join date: 21 Mar 2007
Posts: 8
04-06-2007 03:15
Well, after a long think and seeing quite a few threads on problems people were having with integrating XML-RPC into their objects/scripts, I thought I would post this little tutorial of sorts on the forum. It doesn't go very far but it describes exactly how to communicate with a PHP script from the client and how to communicate FROM a PHP script to an object in game using the XML-RPC interface. The object was tested again today and works perfectly.

While the tutorial itself only goes as far as explaining HOW to communicate the information in there should assist anyone thinking of creating their own Web<->SL application or business front-end. The information was collected from several sites taking and modified for direct socket communication over libraries for ease of integration, as while most PHP hosts have sockets enabled not many(from what I've seen, I'm pretty out of the loop as it were) do not provide XML libraries for immediate use, not to mention Firefox not having support of the XML ActiveX plugins that were used.

Any comments/suggestions/revisions you might have, please post them and I'll be more than happy to respond.

Enjoy! :)

Note: I've cleaned up the code as much as I can presentation wise, but my coding style is somewhat..relaxed so there could be cleaner ways of doing some of the things achieved, but for all intents of purpose it does exactly what it claims

HTTP<->XML-RPC Interface example for Second Life: http://www.othala.co.uk/SL_Scripting

For information regarding the conversion of USD to SLD and back again for ingame->RL purchases refer to this thread: /54/ba/173608/1.html

As I further develop techniques for communicating with an SQL based data server the tutorial will be updated, both on this thread and at Othala.co.uk :)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
04-07-2007 10:47
Nice, though the Wiki has quite a bit more complete information and examples. :)

http://www.lslwiki.net/lslwiki/wakka.php?wakka=XMLRPC
Seidr Giha
Registered User
Join date: 21 Mar 2007
Posts: 8
04-08-2007 02:42
Aye, they have extensive information regarding the LSL side of things and the structure of the XML-RPC request, but do not provide a PHP example for communication via XML. Glad you like it though :)