|
Posted by "Richard Lynch" on 07/22/05 09:43
On Wed, July 20, 2005 12:49 am, Steven said:
> I am looking for a simple way to check if the server is connected to the
> Internet, they use a dialup to get Internet connection, and I need to
> email reports out, but want to check to see if the user remembered to
> connect to the Internet first. If anybody has a nice script, or just a
> suggestion on a php function I could use to test for an Internet
> connection.
I suppose this might work:
<?php
$internet = @fopen("http://php.net");
if (!$internet){
//They are not currently on-line.
}
else{
//They are on-line.
}
?>
It might be better to simply send the email using some kind of mail
software which will either store it until they ARE connected, or that just
connects automatically.
This is on Windows? In the distant past, many folks recommended Pegasus
email client -- it can be run from DOS promt, and hence from
http://php.net/exec, to send out emails, and I would assume it handles the
Internet connection somewhat gracefully.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|