Nandini Posted September 16, 2008 Share Posted September 16, 2008 Hi friends. Is there any way to check internet connection enabled or disable through php scripts. If net connection disabled i have to display "Your Internet connection disabled. Please check." like this. pls send me scripts or url's thanx in advance Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/ Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 Well... you could check yours ISP website and if it's unreachable, say that connection is not working. Will be true in most cases. Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642596 Share on other sites More sharing options...
Nandini Posted September 16, 2008 Author Share Posted September 16, 2008 Hi thanx for ur reply. this is not for website. the requirement is , i am doing a website. I am giving the facility through localhost to see the website for the users. when user login into the website, in the homepage i want to check user system internet connection . If connection enable i have to display as "Your internet connection enabled.". If no "Your internet connection disabled. Please check". How can i do this. Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642615 Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 I can't say I understand Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642617 Share on other sites More sharing options...
Garethp Posted September 16, 2008 Share Posted September 16, 2008 Try this <?php $File = "http://www.google.com.au/images/firefox/sprite.png"; ini_set('display_errors', 0); if (!fopen($File, "r")) { echo "Your internet connection disabled. Please check"; } else { echo "Your internet connection is enabled"; } ini_set('display_errors', 1); ?> Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642625 Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 Except it will test if webserver has the internet connection Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642633 Share on other sites More sharing options...
Garethp Posted September 16, 2008 Share Posted September 16, 2008 What his goal seems to be is that he is hosting it on a Local Network, and whats a user within the network to be able to test whether the network can reach the internet or not. Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642638 Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 Perhaps. I'm curious. Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-642641 Share on other sites More sharing options...
Nandini Posted September 16, 2008 Author Share Posted September 16, 2008 Thanq Garethp Its working fine. thanx for all your support Bye Link to comment https://forums.phpfreaks.com/topic/124430-solved-internet-connection-enable-or-not/#findComment-643095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.