N
Nathan
Guest
The first code I would like to present is a server status code.
What is it used for?
The name should be self explanitory, it displays the current status for a server. Status being "Online" and "Offline". It's a very, very, very, simple code to edit. Where the code states, "SERVER IP + PORT" is where you place the server's IP and the port is the port for the service, 80, 6112, etc. Ports are presented by a colon after the IP, i.e., 65.132.65.43:80.
The format of the code is setup for a game server, you can add and remove servers as needed or rename the servers.
I don't know the server IP.
Ping the URL. For Windows boxes do the following.
Start > Run > CMD > type "ping websiteurl.xxx"
When typing the ping command take away the quotations and do NOT put "type" before the command.
I don't know the port for the server.
According to the server type (HTTP/FTP/SQL/ETC) the ports will vary. I have taken the liberty of listing the common ones below.
HTTP - 80
FTP - Varies
SQL - 1186
For FTP you will need to contact the server administrator, if you are the server administrator then do a port scan.
Start > Run > CMD > type "netstat -a > C:\myports.txt"
When typing the command take away the quotations and do NOT put "type" before the command.
For SQL I'm am completely not sure, that is the general MySQL server port.
For a more detailed list of server ports, you can visit:
http://www.iana.org/assignments/port-numbers
Any questions can be asked in response to this post, please no spam though.
-Dewayne
What is it used for?
The name should be self explanitory, it displays the current status for a server. Status being "Online" and "Offline". It's a very, very, very, simple code to edit. Where the code states, "SERVER IP + PORT" is where you place the server's IP and the port is the port for the service, 80, 6112, etc. Ports are presented by a colon after the IP, i.e., 65.132.65.43:80.
PHP:
<?
error_reporting(0);
$IP = array(
"Login Server" => "SERVER IP + PORT",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo("<font color=\"white\"><b>Login Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Login Server</b> - <font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>
<p></p>
<?
error_reporting(0);
$IP = array(
"Map Server" => "SERVER IP + PORT",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo("<font color=\"white\"><b>Map Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Map Server</b> - <font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>
<p></p>
<?
error_reporting(0);
$IP = array(
"Char Server" => "SERVER IP + PORT",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo("<font color=\"white\"><b>Char Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Char Server</b> - </font><font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>
The format of the code is setup for a game server, you can add and remove servers as needed or rename the servers.
I don't know the server IP.
Ping the URL. For Windows boxes do the following.
Start > Run > CMD > type "ping websiteurl.xxx"
When typing the ping command take away the quotations and do NOT put "type" before the command.
I don't know the port for the server.
According to the server type (HTTP/FTP/SQL/ETC) the ports will vary. I have taken the liberty of listing the common ones below.
HTTP - 80
FTP - Varies
SQL - 1186
For FTP you will need to contact the server administrator, if you are the server administrator then do a port scan.
Start > Run > CMD > type "netstat -a > C:\myports.txt"
When typing the command take away the quotations and do NOT put "type" before the command.
For SQL I'm am completely not sure, that is the general MySQL server port.
For a more detailed list of server ports, you can visit:
http://www.iana.org/assignments/port-numbers
Any questions can be asked in response to this post, please no spam though.
-Dewayne