02.04.2015, 14:38
Hi,
Please explain structure of this code first thing is:
code: "0ay3j5as1Zua55f9T9s2upo" what is code and for what he is using.
What need to write into .php file to get "status", "players" and another server information.
Code:
$.post("http://mywebsite/server_status.php", {code: "0ay3j5as1Zua55f9T9s2upo"}, function( data ) {
var value = parseINIString(data);
if(value["status"])
document.getElementById("serverStatus").innerHTML = '<span class="label label-success">Server is ON</span>';
else
document.getElementById("serverStatus").innerHTML = '<span class="label label-danger">Server is OFF</span>';
if(value["players"] != "")
{
output = 'Players: ' + value["players"] + '/' + value["maxplayers"] + '<br>';
output += 'Version: ' + value["gamemode"] + '<br>';
document.getElementById("serverInfo").innerHTML = output;
document.getElementById("serverUpdate").innerHTML = value["lastupdate"];
}
else
{
menuHomeTime = 0;
}
code: "0ay3j5as1Zua55f9T9s2upo" what is code and for what he is using.
What need to write into .php file to get "status", "players" and another server information.


