Re: checking for internet connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux