Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How do I get the content of a field from a web page?

Eliver Rang
Registered User
Join date: 7 Jun 2007
Posts: 11
06-24-2007 01:50
I want to bring the content of a field on a web page into a script. How do I do that?

Grateful for any clues.
_____________________
Peter Small
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
06-24-2007 05:57
At its simplest you just email the details to an object in SL.
Or there is XML RPC and HTTP support.
Take a look at the communications page in the wikki for more details.
_____________________
I'm back......
Eliver Rang
Registered User
Join date: 7 Jun 2007
Posts: 11
06-24-2007 07:11
Thanks Newgate, but I've already looked through this and as a newbie to LSL I'm totally confused.

Let's say I have a web page that contains only:

<form name="myMessage">My message to a script in SL</form>

How do I get that message from the Web into a variable in my second life script? Remember I'm a newbie with LSL and need all the Is dotted and the Ts crossed :)

Thanks
_____________________
Peter Small
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
Caveat : Newgy is the first to admit his web knowledge is minimal!
06-24-2007 08:52
From: Eliver Rang
Thanks Newgate, but I've already looked through this and as a newbie to LSL I'm totally confused.

Let's say I have a web page that contains only:

<form name="myMessage">My message to a script in SL</form>

How do I get that message from the Web into a variable in my second life script? Remember I'm a newbie with LSL and need all the Is dotted and the Ts crossed :)

Thanks


It will be dependant upon you understanding and use of web side processing.
At its simplest I believe that you could email the form data directly to SL

<form method=POST action="mailto:<myobjectkey>@secondlife.com" .....

And then use the Email event to handle the data. But it would be very dependant upon what you form was doing as to how you then decoded and used the data.

CODE

default
{
state_entry()
{
key objid = llGetKey();
string strid = (string)objid;
llEmail(strid + "@lsl.secondlife.com", "Init", "This is a test message."); // send email to self

llSetTimerEvent(2.5); // poll for emails (yes, that is a retarded way on an event-based system)
}

timer()
{
llGetNextEmail("", ""); // check for email with any subject/sender
}

email(string time, string address, string subj, string message, integer num_left)
{
llSay(0,"Received an email - " + subj);
// .... process received datat here
}
}
_____________________
I'm back......
Eliver Rang
Registered User
Join date: 7 Jun 2007
Posts: 11
06-24-2007 21:14
Thanks Newgate. That provided me with some very useful clues as to how I can go about establishing contact and communication between an object in Second Life and an object embedded in a web page.
_____________________
Peter Small