[insert_php]
$host= $_SERVER[“REMOTE_ADDR”];

echo “Your IP is $host!”;

ini_set(‘max_execution_time’, 0);
ini_set(‘memory_limit’, -1);

$ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306);
$udpports = array(5060,5061);

foreach ($udpports as $udpport)
{
$connection = @fsockopen($host, $udpport, $errno, $errstr, 2);
if (is_resource($connection))
{
echo ‘

‘ . $host . ‘:’ . $udpport . ‘ ‘ . ‘(‘ . getservbyport($port, ‘udp’) . ‘) udp is open.

‘ . “\n”;
fclose($connection);
}
else
{
echo ‘

‘ . $host . ‘:’ . $udpport . ‘ UDP is not responding.

‘ . “\n”;
}
}

foreach ($ports as $port)
{
$connection = @fsockopen($host, $port, $errno, $errstr, 2);
if (is_resource($connection))
{
echo ‘

‘ . $host . ‘:’ . $port . ‘ ‘ . ‘(‘ . getservbyport($port, ‘tcp’) . ‘) is open.

‘ . “\n”;
fclose($connection);
}
else
{
echo ‘

‘ . $host . ‘:’ . $port . ‘ is not responding.

‘ . “\n”;
}
}
[/insert_php]