CMellor Posted December 23, 2006 Share Posted December 23, 2006 Hey, I was hoping you could help me; I am on the search for a bit of code that can tell me if another website on the internet is up and active, or non existent. I know it exists, as I've seen it before, but I can't find anything and I can't find the right keywords to use when searching for it.If anybody knows of such a code, could you direct it to me please?Thanks so much,Chris. Link to comment https://forums.phpfreaks.com/topic/31644-looking-for-a-code-is-website-alive-or-not/ Share on other sites More sharing options...
Eugene Posted December 23, 2006 Share Posted December 23, 2006 [code=php:0]<?PHPif(@fsockopen("somewebsite.com", 80, $erno, $erstr, 30)) { //website exists echo "it exists!!!";} else { echo "{$erno} - {$erstr}";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/31644-looking-for-a-code-is-website-alive-or-not/#findComment-146668 Share on other sites More sharing options...
CMellor Posted December 23, 2006 Author Share Posted December 23, 2006 Awesome, thanks for the quick response.I knew it was a simple code. Shame I can't see to make it work, but that's because I'm testing on my Localhost, so when I try it, it just comes up with "Page cannot be displayed" Ah well, I guess I'll have to wait until I have my web host set up.Thanks again. Link to comment https://forums.phpfreaks.com/topic/31644-looking-for-a-code-is-website-alive-or-not/#findComment-146676 Share on other sites More sharing options...
trq Posted December 23, 2006 Share Posted December 23, 2006 If you have an internet connection it should work. Have you a testing server setup? Link to comment https://forums.phpfreaks.com/topic/31644-looking-for-a-code-is-website-alive-or-not/#findComment-146679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.