View Single Post
  #6  
Old 03-14-2005, 10:45 PM
farce
Hill Giant
 
Join Date: Feb 2003
Posts: 126
Default

Use PHP to open a socket to the telnet port on your world server. Send in the commands to get the list, read out the data into an array then format and display.

pseudo code:

Code:
<?php

$fp = fsockopen('localhost',21, $errno, $errstr,30); // PHP server and world are on the same machine
if(!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fgets($fp, 128); // then keep getting data until an input prompt
    fwrite($fp, "who\n"); // input command
    while(!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
something to that effect =)
Reply With Quote