Re: Checking for internet connection.

From: Date: Sun, 20 Dec 2009 02:36:54 +0000
Subject: Re: Checking for internet connection.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-300596@lists.php.net to get a copy of this message
The next way to handle this might be to code an AIR app. Then it's a simple js trap to see if connectivity exists. Bastien Sent from my iPod On Dec 19, 2009, at 7:13 PM, "Angus Mann" <angusmann@pobox.com> wrote:
Hi all. I'w writing a PHP app that is designed to run over a LAN, so internet connection for the server is not really essential. Some users may deliberately not connect it to the internet as a security precaution. But I'd like the app to make use of an internet connection if it exists to check for an update, and notify the user. Is there a simple way for a PHP script to check if it has an internet connection? I thought of this : if(fsockopen("www.google.com", 80)){ // we are connected } Is this OK or is there something better for the purpose? --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#300596) next »