MrBelfry
IS-IT--Management
- May 21, 2003
- 289
Hey
I'm developing a couple of scripts to serve as an intranet. Some of the scripts allow the user to update a db on a remote server BUT as we're on dialup I wanted to check to see if there is an internet connection available before I give them the option. My feeble newby mind has come up with this:
But I'm wondering if there is a better way?
MrBelfry
I'm developing a couple of scripts to serve as an intranet. Some of the scripts allow the user to update a db on a remote server BUT as we're on dialup I wanted to check to see if there is an internet connection available before I give them the option. My feeble newby mind has come up with this:
Code:
if(@fsockopen('[URL unfurl="true"]www.google.co.uk',[/URL] 80, $errno, $errstr, 10)) echo 'connection available'; else echo 'connection not available';
MrBelfry