strip down Warnings
| From: | dmesg | Date: | Wed, 10 Mar 2004 10:50:58 +0000 |
| Subject: | strip down Warnings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179999@lists.php.net to get a copy of this message | ||
Hi there,
i'm just starting with php.
How can i tell fsockopen() to skip to echo this warnings?
I get all of these warnings and would like to strip them down:
____________________________________________________________________________
____________
Warning: fsockopen(): unable to connect to 192.168.2.209:5800 in
/var/www/htdocs/3.php on line 13
o port 5800 em 192.168.2.210 está aberto
Warning: fsockopen(): unable to connect to 192.168.2.211:5800 in
/var/www/htdocs/3.php on line 13
____________________________________________________________________________
____________
heres my script:
----------------------------------------------------------------------------
------------------------------------------
<html>
<body>
<?php
$rede="192.168.2.";
$portNumber=5800;
for ($i=209;$i<212;$i++){
$targetIP= $rede . $i;
$a[$i]=_scanport ($targetIP, $portNumber);
//echo $a[$i];
}
function _scanPort ($targetIP, $portNumber) {
$handle = fsockopen($targetIP, $portNumber,
$errno, $errstr, 2);
if ($handle) {
fclose($handle);
echo "o port " . $portNumber . "
em <a href=\"http://". $targetIP .":".
$portNumber . "\">". $targetIP .
"</a>". " está aberto<br/>";
}
return 0;
}
?>
</html>
----------------------------------------------------------------------------
---------------------------------------------