inVINCEable Posted July 25, 2008 Share Posted July 25, 2008 What is the best way to test just to see if a website is able to be reached? I am looking at fsockopen but it does not appear to work. I simply want to see if a website like www.google.com ican be reached. Thank you for any advice, pointers. Link to comment https://forums.phpfreaks.com/topic/116607-simplest-way-to-ping-or-test-for-a-website-response/ Share on other sites More sharing options...
fanfavorite Posted July 25, 2008 Share Posted July 25, 2008 Well if you want to know if the domain is registered, you can use checkdnsrr, which you can read about here http://ca3.php.net/checkdnsrr. If it does not exist, then obviously there is no website. Keep in mind though that domains that are parked, with no website, will still show as true. Link to comment https://forums.phpfreaks.com/topic/116607-simplest-way-to-ping-or-test-for-a-website-response/#findComment-599628 Share on other sites More sharing options...
fanfavorite Posted July 25, 2008 Share Posted July 25, 2008 To check for if the website has something, try reading this http://bytes.com/forum/thread2406.html. Link to comment https://forums.phpfreaks.com/topic/116607-simplest-way-to-ping-or-test-for-a-website-response/#findComment-599629 Share on other sites More sharing options...
fanfavorite Posted July 25, 2008 Share Posted July 25, 2008 http://www.weberdev.com/get_example-4335.html is another example you may want to try. Link to comment https://forums.phpfreaks.com/topic/116607-simplest-way-to-ping-or-test-for-a-website-response/#findComment-599631 Share on other sites More sharing options...
Third_Degree Posted July 25, 2008 Share Posted July 25, 2008 fsockopen will work if it is used correctly... You could use something like this: if ( is_numeric( ip2long( gethostbyname( $_GET['host'] ) ) ) ) { print 'Exists!'; } Or fopen( $_GET['host'], 'r' ); Or use what fanfavorite said. Link to comment https://forums.phpfreaks.com/topic/116607-simplest-way-to-ping-or-test-for-a-website-response/#findComment-599632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.