|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
12-12-2007 18:10
hello all you wonderful scripters out there. i need information on how to store information on the web and relay it to a HUD. i build character sheet HUDs for RP. i would love to store the information on the web in a easily accessable manner for ease of change. some examples of scripts and web pages as well as what all is definitively required outside of SL would be appericated.
I have looked into it in the wikki but its not very decent at explaining the entire process or i am just not understanding the way its writen. especialy the PHP portion of the script because i have no clue when it comes to PHP. and help even tutorials would be appericated. thanks
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
12-12-2007 23:59
Explaining the whole PHP-Process would be a little beyond the scope here... Google for tutorials that explain storing stuff in a MySQL-DB, that might be helpful. The Process is something like: -> send a llHTTPRequest from SL to PHP (using POST!) (Pseudo-Code! - just posting untested snippets here...)
key my_request;
my_request = llHTTPRequest("http://my.server.com/my-script.php", [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "sl_var1=hello&sl_var2=world");
http_response(key request_id, integer status, list metadata, string body) { if (my_request == requestid) { llOwnerSay(body); } }
-> fetch the variables with PHP $sql = "INSERT INTO my_table sl_var1, sl_var2 VALUES('".$_POST['sl_var2']."', '".$_POST['sl_var2']."')";
mysql_query($sql);
echo "the entry has been stored in the database"; // this will be «heard» by the calling SL-Script, resulting in the «body» variable in SL
There's a good example on the Wiki: http://www.lslwiki.net/lslwiki/wakka.php?wakka=ExamplellHTTPRequestHTH... 
|