Ok, so i wrote this really simple PHP function to figure out weather or not a port is open on a specific server.
function portcheck($first,$last,$ip){
ini_set('error_reporting', E_ALL);
for($i=$first;$i<=$last;$i++){
if (!@fsockopen($ip, (int)$i, $errno, $errstr, 10)){
echo "<span style='color:#FF0000'>Server Currently Down</span>";
} else {
echo "<span style='color:#00FF00'>Server Currently Up</span>";
}
flush();
}
}
Syntaxed Code: http://www.fiscalleti.com/code.php?title=PHP%20Port%20Checker%20Function&vb=NO&l=php&cmnt=14
I was wondering if anyone knew of a way to make it so that i could also show the number of connections. Thanks!
function portcheck($first,$last,$ip){
ini_set('error_reporting', E_ALL);
for($i=$first;$i<=$last;$i++){
if (!@fsockopen($ip, (int)$i, $errno, $errstr, 10)){
echo "<span style='color:#FF0000'>Server Currently Down</span>";
} else {
echo "<span style='color:#00FF00'>Server Currently Up</span>";
}
flush();
}
}
Syntaxed Code: http://www.fiscalleti.com/code.php?title=PHP%20Port%20Checker%20Function&vb=NO&l=php&cmnt=14
I was wondering if anyone knew of a way to make it so that i could also show the number of connections. Thanks!