I found this script from utorrent: http://www.utorrent.com/testport.php?port=222 which checks if a port is open and was wondering how it worked so I tried to recreate it:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ip = "udp://$ip";
$fp = fsockopen($ip, 222, $errno, $errstr, 30);
if (!$fp) {
echo "$ip<br>Not Open";
} else {
echo "$ip<br>Open";
}
?>
But it does not work as it seems to always say open. What am I doing wrong? Is there another way to do this?
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ip = "udp://$ip";
$fp = fsockopen($ip, 222, $errno, $errstr, 30);
if (!$fp) {
echo "$ip<br>Not Open";
} else {
echo "$ip<br>Open";
}
?>
But it does not work as it seems to always say open. What am I doing wrong? Is there another way to do this?
