how can i make a simple script to see if an irc server is there or not ?
so if it is there it says Up
if its not it says Down
$socket = fsockopen($host, $port, &$errno, &$errstr); if ($socket) { echo "Reaction on Port $host : $port =-> UP"; } else { echo "No Reaction on Port $host : $port =-> DOWN"; }
http://www.php.net/manual/en/function.fsockopen.php
Originally posted by hand $socket = fsockopen($host, $port, &$errno, &$errstr); if ($socket) { echo "Reaction on Port $host : $port =-> UP"; } else { echo "No Reaction on Port $host : $port =-> DOWN"; } http://www.php.net/manual/en/function.fsockopen.php [/B]
Originally posted by hand
http://www.php.net/manual/en/function.fsockopen.php [/B]
thanks alot
umm can u give me an example ? say its irc.hashmark.net port 6667
<? $host = "irc.hashmark.net"; $port = "6667"; $socket = fsockopen($host, $port, &$errno, &$errstr); if ($socket) { echo "Reaction on Port $host : $port =-> UP"; } else { echo "No Reaction on Port $host : $port =-> DOWN"; } ?>
Originally posted by hand <? $host = "irc.hashmark.net"; $port = "6667"; $socket = fsockopen($host, $port, &$errno, &$errstr); if ($socket) { echo "Reaction on Port $host : $port =-> UP"; } else { echo "No Reaction on Port $host : $port =-> DOWN"; } ?> [/B]
[/B]