Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

53 users online



Check if an IP/Site is online?

Check if an IP/Site is online?

Currently viewing this thread: 1 (0 members and 1 guests)


eXer-o

eXer-o

the eXtreme-o dEsign-o!
Status: Offline!

Check if an IP/Site is online?

I used to have a script that would check if a site was online or "Up", but I cant find it anymore,
Basicly what i need help with is pinging/connecting to a site and printing "Offline" or "Online" if it can connect to the site..

Can anyone help?

schoi

schoi

funny and cheeky
Status: Offline!

if your host hasn't blocked the system command why cant u just use that to execute a ping on the server.
system('ping ' . $ping_count . ' ' . $ping_ip_addr); // Ping IP address.
I got this from a website. I didn't think of that but i knew that existed

it can also be a url. The dns will convert it to an ip.

Last edited by schoi, July 31st, 2006 01:25 AM (Edited 1 times)

Xolt

Xolt

Neverside Newbie
Status: Offline!

Not ALL sites will respond to ICMP pings. One example would be CNN.com. A real simple way to check a site out on the standard port (port 80) would be to do

PHP:

<?php

if ($a fsockopen('cnn.com'80))
{
 echo 
'Site appears to be working!';
 
fclose($a);
}

?>

Just a suggestion though, if you're planning to have it open to everyone, having the abilty to check a site via opening/closing a socket upon request, not a good idea because it's a big security hole. I think... Correct me if I am wrong, though.

eXer-o

eXer-o

the eXtreme-o dEsign-o!
Status: Offline!
Originally posted by Xolt:

Not ALL sites will respond to ICMP pings. One example would be CNN.com. A real simple way to check a site out on the standard port (port 80) would be to do

PHP:

<?php

if ($a fsockopen('cnn.com'80))
{
 echo 
'Site appears to be working!';
 
fclose($a);
}

?>

Just a suggestion though, if you're planning to have it open to everyone, having the abilty to check a site via opening/closing a socket upon request, not a good idea because it's a big security hole. I think... Correct me if I am wrong, though.

exacly what i was looking for, thanks!

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.007 seconds.