Navigation :

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




Site Sponsors :

Bookmark :

Links :

low cost magazines
programmershelp
domain names

Downloads :

Misc :

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


scan a range of ports

this uses the Net_PortScan PEAR package to check a range of ports to see if a service is available

<?php
require_once "/home/beginne/php/Net/Portscan.php";

echo "Scanning localhost ports 1-21<br>";
$result = Net_Portscan::checkPortRange("localhost", 1, 21);

foreach ($result as $port => $element)
{
if ($element == NET_PORTSCAN_SERVICE_FOUND)
{
echo "Service found on port " . $port . "<br>";
}
else
{
echo "No service found on port " . $port . "<br>";
}
}
?>