Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

php help pleass

Daved Michigan
Registered User
Join date: 19 Jun 2008
Posts: 1
12-22-2009 18:10
I am looking for a way to grab the transaction xml from my acc page live and phase it through a php script so i can keep track of payments. all i need is to know how to get to get the xml file live (not download it).

so could someone please post maybe a really basic simple php file that would do this i don't need anything special. maybe just a cycle though it and list all the stuff like it does on my accounts page..

please help thank you much
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
12-23-2009 03:12
Whilst it is possible there may be people here who know PHP, it's not really the place to be asking. This forum is mainly for help with scripting objects in-world using LSL. It's not a general scripting/web-development forum. For general, non-SL specific, PHP questions like this I would suggest posting to a PHP-centric forum.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-23-2009 11:06
Ignore the post above this one this IS the place to as questions regarding LSL/PHP. Personally can't help, but someone here should know. This page might be helpful though

http://wiki.secondlife.com/wiki/HTTP_Post_request_to_a_PHP_server
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
12-23-2009 13:01
Only a partial solution, but it might put you on the right track.

From taking a look a the HTML source for the transactions history page, I found that you can grab the XLS from
https://secure-web5.secondlife.com/my/account/download_transactions.php

I think that a parameter to that URL will provide you with the XML instead.

You can use the PHP Curl library to grab the data from the URL so that is can be parsed. Actually if I am not mistaken there are PHP libraries that can parse XLS spreadsheets so you might not need the XML.
Pavcules Superior
Registered User
Join date: 30 Oct 2006
Posts: 69
12-24-2009 06:33
This blog post should help you out further if you want to obtain data between specific dates.

Jerry Krovac
Registered User
Join date: 20 Dec 2009
Posts: 2
12-30-2009 18:56
ok guys i have found that if you type

https://secondlife.com/my/account/download_transactions.php?date_start=2009-11-30&date_end=2009-12-30&type=xml

you can get it to show all the account info for today..

BUT you MUST be logged in. and using the same browser window to get the info so it seems to be using the cookie info to get the feed.. there has got to be a way to automate this from a server.. or there would be no reason to post the blog the post above links to.

can anyone help?
Jerry Krovac
Registered User
Join date: 20 Dec 2009
Posts: 2
12-30-2009 20:55
how about some method using httprequest/response?

could you maybe click an item in game.. have it go to a website read some info from a database that has the info you need then send it back to the server and create a note card in there invo with the info from the website?

what we are wanting to do is have it so you can buy shoutcast streams in game.

but we want it to give you a notcard when you buy it that gives you the stream address port and pass

the port and pass would change with each stream so we need some way to read that info..

what we where thinking before is we could have the site from time to time read the xml say ya a stream and been payed for and then make the stream with a preset port and pass that we already had cards made for..

but could we instead from in game read the webserver get the info needed and make the card?
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
12-30-2009 21:50
The Wiki has an example of using llHTTPRequest in a LSL script to communicate with a php script on a web server.
This is a really barebones example, but of course the PHP script can be fleshed out to talk to an SQL database.
See: http://wiki.secondlife.com/wiki/LlHTTPRequest

Also you don't have to decode the XML transactions to find out if your in-world object has been paid and how much, your object receives this information via the money event when it is paid. See: http://wiki.secondlife.com/wiki/Money

As for writing to a notecard, there is no way to do that via an LSL script, the only way to generate or modify notecards would be via a bot.