send variables to a LSL script and make it deliver an object

722 views Asked by At

I am trying to figure out how to send variables from PHP to a LSL Script and make that script deliver an object, variables like uuid and object.

Not going to post the garbage code that I have as it just doesnt work, more asking for guidance from those that have succeeded in doing this and maybe an example to get me going in the right direction.

1

There are 1 answers

3
Pedro Carvalho On

I am not sure what you need here but you can do that easily by php/mysql and lsl for example:

  • Create a new database, named anything you wish
  • Create a new table with 3 columns

Insert the following data into the structure setup page:

id - is where we will be storing the database record id, this can be used later to process customers.

avatar_key - is the avatar’s in-world UUID which is unique to every avatar in SecondLife.

registration_date - is the date that the user first registered in the following format [YYYY-MM-DD].

Now you need to create a new file named ‘register.php’ in the directory you want to place (domain name/tld)

In your file make the connection to mysql database and you can use this example:

if(!empty($_POST)) {
avatar = $_POST["avatar"];

sql =  "SELECT FROM yourdatabase WHERE avatar_key = '".$avatar."'";
etc etc etc...

echo " something out from the mysql ". $data ['registration_date'] ."!";
etc etc etc as you wish

Now create a object and on touch action you can place this:

string url =  "http://yourdomain.com/yourfile.php"

So this example will output from mysql using php on your "Say" option will echo whatever you want. You can adapt it on your own ways to make more items and fields on your database.

With a example i could correct you, but you need some PHP scripting also lsl knowledge. Wish you the best. Let me know if this help's.