1

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.

Keldo
  • 27
  • 1
  • 5

1 Answers1

1

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.

  • I know how that works as all of my vendors report the user and product to a data table, what I'm looking for is a way to have a PHP Script tell an LSL Script to deliver a requested object to an avatar in SecondLife – Keldo May 16 '17 at 04:18
  • Same thing, instead of echo or add line give item action from.... Same option here, also it can check from the list if is your client to give him/her the items, you can use Give Inventory Option at LSL just echo that. – Pedro Carvalho May 16 '17 at 04:20
  • If i am sure i remember i did answer your question with a valid reply, if you need " example to get me going in the right direction" i just did, now if you want me to place here a full code, now that's another question my friend, but i can show you how. I am also a player in-world. But if this was correct, please reefer and mark it as solved/useful – Pedro Carvalho May 16 '17 at 04:26