Online player counter.

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

sandor

Banned
Feedback score
7
Posts
270
Reactions
48
Resources
0
Banned forever. Reason: Creating Multiple Accounts (Luann, https://builtbybit.com/members/luann.150033/)

Shaun

Web Developer, owner of Syncore LLC
Supreme
Feedback score
20
Posts
622
Reactions
408
Resources
0
Hey I can set this up on your site for $7, add me on Discord here: Athys#9347.
 

sandor

Banned
Feedback score
7
Posts
270
Reactions
48
Resources
0
Banned forever. Reason: Creating Multiple Accounts (Luann, https://builtbybit.com/members/luann.150033/)

MaccariTA

Feedback score
4
Posts
201
Reactions
47
Resources
0
Owh my bad, how would I do that?
Simply create an AJAX call to the URL https://mcapi.de/api/server/play.hypixel.net/25565
I will attach a simple snippet of an AJAX call, please make sure that you parse the JSON returned from the request. Also, I would recommend using a library such as JQuery for the AJAX request. Good luck.

This is a JavaScript snippet, not PHP
PHP:
var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == XMLHttpRequest.DONE) {  
           if (xmlhttp.status == 200) {
               document.getElementById("players").innerHTML = xmlhttp.responseText;
           }
        }
    };

    xmlhttp.open("GET", "https://mcapi.de/api/server/play.hypixel.net/25565", true);
    xmlhttp.send();

The HTML code
HTML:
<div id="players"></div>
 
Status
This thread has been locked.
Top