Thanx to [lexx][/QUOTE]
Which is all in all a very neat script, prolly couldn't have written it better myself, but a lot more complicated then what the topicstarter needs I deem :) All he probably needs is this:
[php] echo fsockopen("ip.adres.here", port, $errno, $errstr, 2) ?
"Server is online!" : "Server is offline!"; [/php]
With the values filled in for my webserver this becomes:
[php]echo fsockopen("fragfrog.nl", 80, $errno, $errstr, 2) ?
"Server is online!" : "Server is offline!";[/php]
If it tends to state a server is offline when really it isn't, increase the last number (the 2) to a bigger value - this is the timeout in seconds, and sometimes a server fails to respond within the time given. Do note that if you increase it a lot people loading your page will also have to wait for that amount of time. Ie, if you set it to be 30 instead of 2 and a server is offline, people will need to wait 30 seconds before the page continues loading. There are ways around this, but not neat or simple ones as far as I know :smile: