You are here: Re: [PHP] checking for internet connection « PHP « IT news, forums, messages
Re: [PHP] checking for internet connection

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация