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:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 3:12 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to