you can use this techniques forexample an external mysql connection <=> maniascript

ManiaScript
declare this as script global variable for your script
Code: Select all
#Include "Libs/Nadeo/Json.Script.txt" as JSON
declare CHttpRequest[] myRequests = CHttpRequest[];Â
(very simple httprequest manager)
Code: Select all
declare Integer[] toRemove = Integer[];
declare x = 0;
foreach (req in Http.Requests) {
    if (req.IsCompleted) {
        log(req.Result);   Â
        toRemove.add(x);
    }
    x += 1;
}
foreach (index in toRemove) {   Â
    Http.Destroy(Http.Requests[index]);   Â
}
Â
Code: Select all
myRequests.add(Http.CreatePost("http://localhost/tm2/test.php", "{" ^JSON::Stringify("player",Event.Player.User, "") ^"}"));
Also
it's very important remeber to add the object tags "{ }" around the json library output...
php
Code: Select all
<?php
file_put_contents("log.txt", $HTTP_RAW_POST_DATA, FILE_APPEND);
$object = (object) json_decode($HTTP_RAW_POST_DATA);
// all you echo, will be sent back to the maniascript...so generate the xml document here
if ($object->player->Login == "reaby") {
    echo "yay!!";
}
print_r($object);  // this will output the recieved object values to your maniaplanet debug window
 ?>