dep
08-02-2004, 07:46 AM
Hello i am trying to make a addon for my users i have got the php code, but am not sure how i go about converting to make it work with vbadvance.
any help would be much welcomed.
<?php
error_reporting(1);
echo "Status obtained on the </p>";
$offset = 3600*1;
$date = gmdate("jS F Y, h:i A", time() + $offset);
echo $date, "<br><br>\n";
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function testServer ($address, $port, $serverName) {
$time_start = getmicrotime();
$fp = fsockopen ($address, $port, $errno, $errstr, 5);
if (!$fp) {
echo "<font color=red>$serverName is Down. </font><br>\n";
} else {
$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time*1000,2);
echo "<font color=green>$serverName is Up.</font><br>\n";
fclose ($fp);
}
return;
}
testServer("www.legendofmir.net", 80, "Offical Web Site");
testServer("forum.legendofmir.net", 80, "Offical Forum");
testServer("patch.legendofmir.net", 21, "AutoUpdate");
testServer("217.65.66.20", 80, "Game Server");
?>
any help would be much welcomed.
<?php
error_reporting(1);
echo "Status obtained on the </p>";
$offset = 3600*1;
$date = gmdate("jS F Y, h:i A", time() + $offset);
echo $date, "<br><br>\n";
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function testServer ($address, $port, $serverName) {
$time_start = getmicrotime();
$fp = fsockopen ($address, $port, $errno, $errstr, 5);
if (!$fp) {
echo "<font color=red>$serverName is Down. </font><br>\n";
} else {
$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time*1000,2);
echo "<font color=green>$serverName is Up.</font><br>\n";
fclose ($fp);
}
return;
}
testServer("www.legendofmir.net", 80, "Offical Web Site");
testServer("forum.legendofmir.net", 80, "Offical Forum");
testServer("patch.legendofmir.net", 21, "AutoUpdate");
testServer("217.65.66.20", 80, "Game Server");
?>