Number of users online, their names and the number, using php.
It's my first Php code so don't be rude if it's extremly ugly, basic.
It will show the name and the amount of the connected characters char.
Code:
<?php
$Server = 'Host.com';
$Port = 9000;
$user = "your_user\r";
$pass = "your_pass\r";
$fp = fsockopen($Server, $Port);
fputs ($fp, $user);
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
fputs ($fp, "who\r");
usleep(125000);
do
{
$output = fgets($fp);
$output = str_replace("Username: Password: Login accepted.", "", $output);
$output = str_replace($user">", "", $output);
$output = str_replace("who", "", $output);
$output = str_replace("Players", "", $output);
$output = str_replace("on", "", $output);
$output = str_replace("server:", "", $output);
$output = str_replace("line", "", $output);
$who = preg_replace('#^.*]\s+(.*?)\(.*$#','\1',$output);
echo $who;
if (preg_match("/Players/i", $who)) {
Break;
}
}
while(!feof($fp));
fclose($fp);
?>
Mag