Thursday, June 04, 2026 12:03:46 AM
> updatePlayers.php
<?php
	/*
		Bryan
		Exile Server Manager
	*/
	require "config/config.php";

	// Make sure this is legit request
	if (!array_key_exists($_POST["key"], $SERVERS))
	{
		die("failed");
	}

	$key = $_POST["key"];

	// Remove the header so we can go ahead and process the rest
	unset($_POST["key"]);

	$players = [];
	$count = 0;
	for ($i = 0; $i < count($_POST) - 1; $i += 2)
	{
		array_push($players, [
			"name" => $_POST["player_" . $count . "_name"],
			"uid" => $_POST["player_" . $count . "_uid"]
		]);
		$count++;
	}

	$players = json_encode($players);

	mysqli_query($esm_db, "UPDATE servers SET online_players = '$players' WHERE server_key = '$key'");
?>
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2