PHP/HTML/GMod Lua help

Im trying to make a system who get all online/offline staff of a server and then to print it on a .php with html code, someone knows how to do it? example there:

PD: Im new in PHP & MySQL

Put the owners inside a database/array, and run a for loop that checks the Steam Web-API on their profile for online status - only problem would be if they got an ‘friends only’ or ‘private’ profile, since that still shows them as offline.

It’s a good solution - but I think he meant staff online on the server.
In which case you would have to use mysql.

He could just use GET and put the input in an array. And do that every 5minutes. Remember to only accept a get input from your servers ip.

Would be expensive, I’d go with neth’ way, check upon player join if its the desired rank, if so, send an update to the database & do the same with Disconnect/ShutDown.

How would that be expensive?

Bandwidth side/sending useless data(which is unupdated) every 5 minutes.

And how i do the loop?

But so would updating the database and retrieving it to display. Plus every 5 minutes was just an example. You could easily make it so that it will only update if the value changes.

$users = $db->query("SELECT * FROM `ranks`");
    foreach($users as $ranks) { ?>

Thats the SQL way.

[editline]24th December 2015[/editline]

Yeah but the GET way is an ‘harder’ way since imagine if the servers IP changes etc etc.

Hello Neth o/

The IP won’t just change randomly, lol. And no it’s not harder.

‘Imagine the IP changes’ -> Requests an IP change of the server; Never owned a server and got attacks? The way you mentioned is an ‘unoptimized’/harder way, it generally takes more code to put all that stuff in an GET string, retrieve the data etc, the easiest way is an updating database.

Could be easily changed. But yeah forget what I said. I don’t think you wanna mess with json and get. Use mysql.

Specially since JSON & GET is an ‘harder’ way to do for an beginner in PHP, SQL only needs 1 line for updating, nothing more.

Are you sure you meant GET and not POST?

He thinks an simple IP check aint bypassable, so thats why he prob took GET.

Yes I meant GET. I think you are confusing gmods with php POST.

[editline]25th December 2015[/editline]

Yeah no it isn’t easy.


“it isnt easy” say that when it gets exploited, lol. And post IS possible with DHTML “custom” html.