• Get server info - no open ports or PHP required
    4 replies, posted
Hey guys, I've got a little thing for server owners, which I know gave me problems before I got a VPS. I've made a way for anyone to get the server data without the need for PHP or open ports: Add this to the bottom of your HTML code (you also need jQuery, from Google, or whoever): [CODE] <script type="text/javascript" src="http://static.sidewaykill.com/js/jQuery/jquery.cdr.js"></script> <script type="text/javascript"> $(document).ready(function() { requestCrossDomain('http://api.sidewaykill.com/srcds-status/count?ip=103.23.148.108:29015&format=html', function(results) { $('#container2').html(results); }); }); $(document).ready(function() { requestCrossDomain('http://api.sidewaykill.com/srcds-status/count?ip=54.252.147.1:27015&format=html', function(results) { $('#container3').html(results); }); }); </script> [/CODE] It will then replace any div (or span etc.) with the ID's specified with the server count. If you want to use this code with CURL or something, just change the format variable to none, instead of HTML. I'll be adding more things such as server name, game, etc. Example: [url]http://jsfiddle.net/96L33/[/url]
Please find me a web host to put this script on that doesnt have php. And what do you mean without ports?
Enjin, Webs, Weebly, PasteHTML, even a fastdl server? Also, to query a source server, the port your game server is on needs to be open UDP on your web host, and most web hosts (in Aus anyway), dont allow opening ports.
[QUOTE=FrankPetrov;40206830]Please find me a web host to put this script on that doesnt have php. And what do you mean without ports?[/QUOTE] Rather than you writing up a PHP script to query a server to get the details it uses a third-party API which does the querying for you and then returns the results to your webpage. This can be used on any web host, as Javascript is a client-side language and is dealt with by the browser.
-snip- i buggered up
Sorry, you need to Log In to post a reply to this thread.