Hey guys! So basically, I'm creating a server that communicates through HTTP Requests with my PHP script on my website. It works fine for sending data from my object in-world to my server, and returning what the script outputs through the Body of http_response. What I have yet to figure out how to do, is send information form my PHP script, to my object in-world, without calling an HTTPRequest in the object first. Also, I noticed there are two different forms of: llHTTPRequest() / http_response and llHTTPResponse() / http_request. Currently I'm just using the first set, in what cases is http_request / llHTTPResponse used? Here's an example of my LSL and PHP scripts: string url = "mysiteurl/databaseinterface.php"; list params = [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"]; default
{
state_entry() {
request_and_release();
llHTTPRequest(url, params, "action=connect");
}
http_response(key request_id, integer status, list metadata, string body)
{
if(body == "Connected to Database.")
{
llSay(0, body); } } } <?php
$action=$_POST['action'];
$avatarname = $_POST['avatarname'];
if($action == 'connect') // Test Connection
{
echo('Connected to Database.');
}
?> Edit: These are obviously not my full scripts, I just put these snippets in here so you could see my general syntax/flow. Thanks!