Jump to content
  • 0

[help] status checker


Question

Posted
<?php

 

$server = "localhost";

$port = "2106";

 

function pingDomain($server){

    $starttime = microtime(true);//Server 1 Port

    $file      = fsockopen ($domain, 2106, $errno, $errstr, 10);

    $stoptime  = microtime(true);

    $status    = 0;

 

    if (!$file) $status = -1;

    else {

        fclose($file);

        $status = ($stoptime - $starttime) * 1000;

        $status = floor($status);

    }

    return $status;

}     

 

        $status = pingDomain($serverbase);

        if ($status <= 50) $MessageStatus = "Great";

        elseif ($status <= 80) $MessageStatus = "Good";

        elseif ($status <= 100) $MessageStatus = "Ok";

        elseif ($status <= 150) $MessageStatus = "Bad";

        elseif ($status <= 999) $MessageStatus = "Poor";

        else $MessageStatus = "Disconnected";

 

 

$upmessage = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>$MessageStatus</font><br>";

$downmessage = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>Disconnected</font><br>";

$tout = "5";

$server1 = @fsockopen ($server, $port, $errno, $errstr, $tout);

if(!$server1){ echo"<br><font color='C8B560' size='2' style='Arial'><strong>Login</strong></font><br><font

 

size='1' color='white'>Status:</font><font color='red' size='1' style='Arial'> Off</font>$downmessage"; }

else { echo"<br><font color='C8B560' size='2' style='Arial'><strong>Login</strong></font><br><font size='1'

 

color='white'>Status:</font><font color='green' size='1' style='Arial'> On</font>$upmessage"; }

 

$server2 = "localhost";

$port2 = "7777";

 

function pingDomain2($server2){

    $starttime2 = microtime(true);//Server 2 Port

    $file2      = fsockopen ($domain2, 7777, $errno, $errstr, 10);

    $stoptime2  = microtime(true);

    $status2    = 0;

 

    if (!$file2) $status2 = -1;

    else {

        fclose($file2);

        $status2 = ($stoptime2 - $starttime2) * 1000;

        $status2 = floor($status2);

    }

}     

 

        $status2 = pingDomain2($serverbase2);

        if ($status2 <= 50) $MessageStatus2 = "Great";

        elseif ($status2 <= 80) $MessageStatus2 = "Good";

        elseif ($status2 <= 100) $MessageStatus2 = "Ok";

        elseif ($status2 <= 150) $MessageStatus2 = "Bad";

        elseif ($status2 <= 999) $MessageStatus2 = "Poor";

        else $MessageStatus2 = "Disconnected";

 

 

$upmessage2 = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>$MessageStatus2</font><br>";

$downmessage2 = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>Disconnected</font><br>";

$tout = "5";

$server2 = @fsockopen ($server2, $port2, $errno, $errstr, $tout);

if(!$server2){ echo"<br><font color='C8B560' size='2'

 

style='Arial'><strong>Gameserver</strong></font><br><font size='1' color='white'>Status:</font><font

 

color='red' size='1' style='Arial'> Off</font>$downmessage2"; }

else { echo"<br><font color='C8B560' size='2' style='Arial'><strong>Gameserver</strong></font><br><font

 

size='1' color='white'>Status:</font><font color='green' size='1' style='Arial'> On</font>$upmessage2"; }

?>

 

Λοιπόν αυτό το status checker μου φένεται πως είναι το καλύτερο... Αλλά δεν καταλαβένω γιατί αργεί...

Αν μπορεί καποιος που είναι πιο έμπειρος να μου το editarei ωστε να δείχνει μόνο το status  του login/game server και όχι το stability. Διαφορετικά πείτε μου τι να κάνω ώστε να φορτώνει πρώτα την ιστοσελίδα μου και αφού τελείωσει να φορτώνει τον status checker. Btw ο κώδικας της ιστοσελίδας μου είναι ο παρακάτω.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Shadow Warez!</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<style type="text/css">

<!--

 

-->

</style>

 

<script type="text/javascript">

<!--

 

var alternate=0

var standardbrowser=!document.all&&!document.getElementById

 

if (standardbrowser)

document.write('<form name="tick"><input type="text" name="tock" size="11"></form>')

 

function show(){

if (!standardbrowser)

var clockobj=document.getElementById? document.getElementById("digitalclock") : document.all.digitalclock

var Digital=new Date()

var hours=Digital.getHours()

var minutes=Digital.getMinutes()

var dn="ΠM"

 

if (hours==12) dn=""

if (hours>12){

dn="ΜΜ"

hours=hours-12

}

if (hours==0) hours=12

if (hours.toString().length==1)

hours="0"+hours

if (minutes<=9)

minutes="0"+minutes

 

if (standardbrowser){

if (alternate==0)

document.tick.tock.value=hours+" : "+minutes+" "+dn

else

document.tick.tock.value=hours+"   "+minutes+" "+dn

}

else{

if (alternate==0)

clockobj.innerHTML=hours+" : "+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"

else

clockobj.innerHTML=hours+" : "+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"

}

alternate=(alternate==0)? 1 : 0

setTimeout("show()",1000)

}

window.onload=show

 

//-->

</script>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

</head>

<body>

<div class="header">

    <img src="icons/header.jpg" width="700" height="188" style="float:left;" />

   <u>Latest News</u> <br />

     <li style="color:#990000;" /><span style="color: #FFFFFF; text-align: center; font-size: 12px;">Welcome to our site!

     </span> <br />

     <span style="font-size:10px;color:#990000; text-align:left;margin-left: 10px; font-style:normal;">Hope you have an enjoyable time in our site

</span>

     <li style="color:#990000;" /><span style="color: #FFFFFF; text-align: center; font-size: 12px;">Site is under Construct </span>

<br /><span style="font-size:10px;color:#990000; text-align:left;margin-left: 10px; font-style:normal;">Last Update at: Monday, January 12, 2009 9:43 PM</span></div>

<div class="time">

<script type="text/javascript">

var mydate=new Date()

var year=mydate.getYear()

if (year < 1000)

year+=1900

var day=mydate.getDay()

var month=mydate.getMonth()

var daym=mydate.getDate()

if (daym<10)

daym="0"+daym

var dayarray=new Array("Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμτπη","Παρασκευή","Σάββατο")

var montharray=new Array("1","2","3","4","5","6","7","8","9","10","11","12")

document.write(""+dayarray[day]+", "+daym+"/"+montharray[month]+"/"+year+"")

</script> /

<span id="digitalclock"></span>

</div>

<div class="navbarl">

<table border="0" cellpadding="0" cellspacing="0" width="200">

<tr><td height="40" style="background:url('icons/15.gif');color:#333333;" align="center"><b>Site menu</b></td></tr>

<tr><td><A href="http://ntellos.freehostia.com/" target="_blank"><STRONG><span style="margin-left: 20px;color:#FFFFFF;">Forum</span></STRONG></A></LI></span></td></tr>

<tr><td><A href="mailto:ntellos13@hotmail.com"><STRONG><span style="padding-left: 20px;color:#FFFFFF;">Επικοινωνήστε μαζί μας!</span></STRONG></A></LI></span></td></tr>

<tr><td><A href=""><STRONG><span style="padding-left: 20px;color:#FFFFFF;"></span></STRONG></A></LI></span></td></tr>

<tr><td><A href=""><STRONG><span style="padding-left: 20px;color: #FFFFFF;"></span></STRONG></A></LI></td></tr>

</table>

<br />

<table border="0" cellpadding="0" cellspacing="0" width="200">

<tr><td height="40" style="background:url('icons/15.gif');color:#333333;" align="center"><b>Site Status</b></td></tr>

<tr><td><?php

 

$server = "localhost";

$port = "2106";

 

function pingDomain($server){

    $starttime = microtime(true);//Server 1 Port

    $file      = fsockopen ($domain, 2106, $errno, $errstr, 10);

    $stoptime  = microtime(true);

    $status    = 0;

 

    if (!$file) $status = -1;

    else {

        fclose($file);

        $status = ($stoptime - $starttime) * 1000;

        $status = floor($status);

    }

    return $status;

}     

 

        $status = pingDomain($serverbase);

        if ($status <= 50) $MessageStatus = "Great";

        elseif ($status <= 80) $MessageStatus = "Good";

        elseif ($status <= 100) $MessageStatus = "Ok";

        elseif ($status <= 150) $MessageStatus = "Bad";

        elseif ($status <= 999) $MessageStatus = "Poor";

        else $MessageStatus = "Disconnected";

 

 

$upmessage = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>$MessageStatus</font><br>";

$downmessage = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>Disconnected</font><br>";

$tout = "5";

$server1 = @fsockopen ($server, $port, $errno, $errstr, $tout);

if(!$server1){ echo"<br><font color='C8B560' size='2' style='Arial'><strong>Login</strong></font><br><font

 

size='1' color='white'>Status:</font><font color='red' size='1' style='Arial'> Off</font>$downmessage"; }

else { echo"<br><font color='C8B560' size='2' style='Arial'><strong>Login</strong></font><br><font size='1'

 

color='white'>Status:</font><font color='green' size='1' style='Arial'> On</font>$upmessage"; }

 

$server2 = "localhost";

$port2 = "7777";

 

function pingDomain2($server2){

    $starttime2 = microtime(true);//Server 2 Port

    $file2      = fsockopen ($domain2, 7777, $errno, $errstr, 10);

    $stoptime2  = microtime(true);

    $status2    = 0;

 

    if (!$file2) $status2 = -1;

    else {

        fclose($file2);

        $status2 = ($stoptime2 - $starttime2) * 1000;

        $status2 = floor($status2);

    }

}     

 

        $status2 = pingDomain2($serverbase2);

        if ($status2 <= 50) $MessageStatus2 = "Great";

        elseif ($status2 <= 80) $MessageStatus2 = "Good";

        elseif ($status2 <= 100) $MessageStatus2 = "Ok";

        elseif ($status2 <= 150) $MessageStatus2 = "Bad";

        elseif ($status2 <= 999) $MessageStatus2 = "Poor";

        else $MessageStatus2 = "Disconnected";

 

 

$upmessage2 = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>$MessageStatus2</font><br>";

$downmessage2 = "<font size='1' color='white'><br>Stability: </font><font color='gray'

 

size='1'>Disconnected</font><br>";

$tout = "5";

$server2 = @fsockopen ($server2, $port2, $errno, $errstr, $tout);

if(!$server2){ echo"<br><font color='C8B560' size='2'

 

style='Arial'><strong>Gameserver</strong></font><br><font size='1' color='white'>Status:</font><font

 

color='red' size='1' style='Arial'> Off</font>$downmessage2"; }

else { echo"<br><font color='C8B560' size='2' style='Arial'><strong>Gameserver</strong></font><br><font

 

size='1' color='white'>Status:</font><font color='green' size='1' style='Arial'> On</font>$upmessage2"; }

?></td>

</tr>

</table><br />

</div>

 

<div class="navbarr">

<table border="0" cellpadding="0" cellspacing="0" width="200">

<tr><td height="40" style="background:url('icons/15.gif');color:#333333;" align="center"><b>Login</b></td></tr>

<tr><td><center><span style="color:#990000;">Closed!</span>

<br />

<span style="color:#FFFF66; font-size:9px;">Although you can login normally in our forum</span>

</center>

</td></tr>

<tr><td height="40" style="background:url('icons/15.gif');color:#333333;" align="center"><b>Friendly Sites</b></td></tr>

<tr><td><tr><td><A href="http://turboradio.ucoz.com/" target="_blank"><STRONG><span style="margin-left: 75px;color:#FFFFFF;">turbo radio</span></STRONG></A></LI></span></td>

</tr>

</table>

</div>

 

<div class="centerbox">

<table border="0" cellpadding="0" cellspacing="0" width="500">

<tr><td height="40" style="background:url(''); color:#333333;" align="center">Server Updates!</b></td></tr>

<tr><td>

<center><u>Quick Links</u>

<br /><a href="http://www.google.gr">Google.gr</a>

<br /><a href="http://www.youtube.com">Youtube.com</a>

<br />

<br />

<br /><a href="info.php">My PHP info</a>

<br /><a href="/forum/">SMF Test Forum</a>

<br /><a href="/forum2/">VB Test Forum</a>

<br /><a href="/forum2/admincp/index.php">VB admin panel</a>

<br /><a href="/pma/">PhpMyAdmin</a>

<br />

<br /></center><span style="color:#990000;">=ADMIN=Ntellos</span>

<br />

</tr></td>

 

</table>

</div>

 

 

 

 

 

<div class=sig>

<table border="0" cellpadding="0" height="45" cellspacing="0" style="background:url('icons/16.gif') #C9C9C9;">

<tr><td align="left"><img src="icons/17.gif" border="0"></td><td align="center" style="color:#333333;">2008 Shadow-warez all rights reserved |</td><td align="center" style="color:#333333;"> Powered by <span style="color:#990000">=Admin=Ntellos</span> |

<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fntellos13.freehostia.com%2F&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.606">

<img  style="border:0;width:48px;height:11px"

        src="http://www.w3.org/Icons/valid-xhtml10-blue"

        alt="Valid XHTML 1.0 Transitional" />

</a>

<a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fntellos13.freehostia.com%2F&profile=css21&usermedium=all&warning=1&lang=en">

    <img  style="border:0;width:48px;height:11px"

        src="http://jigsaw.w3.org/css-validator/images/vcss-blue"

        alt="Valid CSS!" />

</a>

</td><td align="right"><img src="icons/18.gif" border="0"></td></tr>

</table>

</div>

</body>

</html>

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • We can help your Telegram group or channel grow fast with real, targeted Telegram members, safely and efficiently.   Our Telegram Member Add service lets you add members to Telegram group or channel from real, active communities — not bots or fakes.   With this Telegram group growth service, you’ll see results within hours, backed by clear reporting and safe automation.   ✅ What We Offer   • Done-for-you Telegram Member Add campaigns (Groups · Channels) • Targeted Telegram members from real, active users • Fast growth — up to 10K members in 24 hours • English-speaking or regional audiences (US · UK · EU) • Fully managed Telegram channel growth service with reports & analytics   💡 Why Choose Us   We don’t use spam or fake accounts. Our process safely adds members to your Telegram group or channel through verified multi-account setups, proxy rotation, and opt-out compliance. This ensures lasting growth and minimizes churn. Every campaign is managed by experts using tested Telegram infrastructure and growth systems. We also recommend combining Member Add with Telegram Mass DM for better engagement and retention after join.   🧩 Works Best For   • Businesses or communities launching new Telegram channels • Crypto, SaaS, and marketing projects needing visibility • Influencers and agencies growing multiple Telegram groups • Anyone seeking a reliable Telegram group growth service with real members 📩 To Get More Information   Telegram : @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-member-add.html
    • well,its SharedCreatureData.h problem.   /* 0398 */ //WCHAR m_sResurrectSpellerName[25];   this variable will cause L2server.exe crash...  
    • Custom High Five server L2insolence will open 2025-10-17 21:00 GMT+2 ! ! ! Web site: http://www.l2insolence.eu All info updates on Discord: https://discord.gg/duMjnj3y9A Last wipe was more then 1 year ago. We have custom skill, farm zones, materials for items to buy. Custom wepons, armor, jewels and more. All items in game have own stats. With custom looks. Glowing etc. Rates XP, SP: 25x Spoil and Drop: 10x Adena: 20x Server Hard Farm Enchantment Safe enchant Weapon: +20099 Safe enchant Armor: +20099 Max enchant Weapon: +20099 Max enchant Armor: +20099 Normal scrolls: 100% Blessed scrolls: 100% You can use scrolls or item enchant NPC to make +++ abd life beter. NPC Buffer There's an NPC buffer in all of our main towns: Aden, Giran and Goddard. It supplies Prophet Buffs, Songs and Dances for a small fee. Include all buff. We have custom self buffs learned with npc with custom stats. Global Gatekeeper GM Shop with normal items and custom ones, vote NPC, Event NPC, item upgrader NPC. Raid Bosses, every zone have its own boss and drops for rare mats. Olympiad The olympiad is ongoing every two weeks. Meaning if you become a hero you will have your hero status for two weeks. And hero have own custom stats on items.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock