boss302_lp
asked on
remote server online
i need a php script that will check to see if a remote server is online
if this server is online it will output the html code:
<html><script>top.location = ""</script></html>
if the server is offline it will just echo the text "We are experiencing technical difficulties..."
if this server is online it will output the html code:
<html><script>top.location
if the server is offline it will just echo the text "We are experiencing technical difficulties..."
If you want to request to port 80 check out the following.
########################## ###
<?php
$sock = fsockopen("www.remote-server.com", 80);
if(!$sock){ ?>
We are having server difficulties....
<?php } else {
fclose($sock);
}
########################## ###
I haven't checked out the php-ping package, I just found it on google.
##########################
<?php
$sock = fsockopen("www.remote-server.com", 80);
if(!$sock){ ?>
We are having server difficulties....
<?php } else {
fclose($sock);
}
##########################
I haven't checked out the php-ping package, I just found it on google.
if (!($a=fopen("http://server.address.com/"))) {echo "<html><script>top.locatio n = /"/"</script></html>";clos e($a)}
else echo "We are experiencing technical difficulties..."
else echo "We are experiencing technical difficulties..."
ASKER
ping wont seem to work, and my server is on 8080, so i'd need the other two script to check on 8080, but when i modify any of the scripts to suit my needs, i get no output, as well i tried this to check if experts-exchange.com was online, and still nothing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check out http://www.hotscripts.com/Detailed/11461.html
Another way would be to make a request to it at port 80, and if it is successful, you are okay, and if it fails......