RE: [PHP] Link Validator

From: Date: Wed, 31 Jan 2001 06:38:28 +0000
Subject: RE: [PHP] Link Validator
Groups: php.general 
Request: Send a blank email to php-general+get-37426@lists.php.net to get a copy of this message
What do you mean by 'Not always right' ? If it wouldn't be right your server would be crashing every 0.0000001 seconds ... anyway ... If this is locally, and all you need to know is if there a page called foo.html on the same server from where you are trying to check you can then use file_exists() if(file_exists($DOCUMENT_ROOT.$file)) echo 'Sure, it is there ...'; otherwise (if it is a remote server) try fopen() or fsockopen() ... ie $url = "www.altavista.com"; $port = "80"; $timeout_in = "30"; #seconds $fp = fsockopen ($url, $port, $timeout_in); if($fp) echo "Site Accessed!"; yeah .. look here: www.php.net/fsocopen they have an example of use which you could modify to make it a link checker. Cheers, Maxim Maletsky -----Original Message----- From: Huseyin [mailto:hezeybek@yahoo.com] Sent: Wednesday, January 31, 2001 3:12 PM To: php-general@lists.php.net Subject: [PHP] Link Validator hi i am a newbie and i was wondering how can i check the link if it exists i tried file_exists but it is not laways right thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#37426) next »