Server Startup (php)

Socius Decennalis
Decennium
Joined
Dec 22, 2013
Messages
65
Reaction score
13
<?php


/*change your server's name and host*/
$server['name'] = "DivinePT";
$server['host'] = "82.161.22.119";
$server['port'] = "90";




/*no need to change the further code*/
$connection = @fsockopen($server['82.161.22.119'], $server['90'], $ERROR_NO, $ERROR_STR, (float)1.5);


echo "{$server['DivinePT']} PristonTale server is ";


if($connection)
{
fclose($connection);
echo "<font color=\"green\">online</font>";
}
else
{
echo "<font color=\"red\">offline</font>";
}
?>

Server.exe not connect.

i am fill $server['host'] = NAME\SQLEXPRESS server startup show Off
i am fill $server['host'] = IP server startup show On

help me fix thanks.
 
You see the part that says
/*no need to change the further code*/

You should have really taken that advice...
You messed up the code by putting the ip and port below that.

$connection = @fsockopen($server['82.161.22.119'], $server['90'], $ERROR_NO, $ERROR_STR, (float)1.5);
Should be
$connection = @fsockopen($server['host'], $server['port'], $ERROR_NO, $ERROR_STR, (float)1.5);

And...
echo "{$server['DivinePT']} PristonTale server is ";
should be
echo "{$server['name']} PristonTale server is ";
Fixed script below.

PHP:
<?php 


/*change your server's name and host*/ 
$server['name'] = "DivinePT"; 
$server['host'] = "82.161.22.119"; 
$server['port'] = "90"; 




/*no need to change the further code*/ 
$connection =   [USER=493081]fsockopen[/USER]($server['host'], $server['port'], $ERROR_NO, $ERROR_STR, (float)1.5);


echo "{$server['name']} PristonTale server is ";


if($connection) 
{ 
    fclose($connection); 
    echo "<font color=\"green\">online</font>"; 
} 
else 
{ 
    echo "<font color=\"red\">offline</font>"; 
} 
?>

You should ONLY edit the following parts that are in bold;
$server['name'] = "DivinePT";
$server['host'] = "82.161.22.119";
$server['port'] = "90";

Example this page:
Pings English Pristontales login server ip '107.6.2.139' on port '10007'.

Script works fine, you just dun goofed it up.


NOTE: This script does not check to see if the physical pristontale server software is running.
It just checks if it can connect to the specified IP through the specified port.
Your PT server software could be not running, and it will still say that it is online becase it only checks to see if a connection to the server computer through the specified port can be made.
 
Last edited:
Upvote 0
Back