Computing.Net > Forums > Web Development > How to check external URL exists

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to check external URL exists

Reply to Message Icon

Name: deadlydog
Date: March 22, 2005 at 12:19:06 Pacific
OS: Mandrake 10.1
CPU/Ram: P233
Comment:

I want to be able to check if a URL is live or not. Basically I want to make a function I can call and supply the URL, and it checks to see if the URL is currently up and running or not. I'm using html, javascript, and php. Currently I'm just doing this with php:

function URLIsLive($URL)
{
return fopen($URL, 'r');
}

It does work for what I need, but it is painfully slow, whether the websites are up or not. It takes about 15 seconds to load the page, which sux. Is there a faster way to do this?

Thanks. Dan



Sponsored Link
Ads by Google

Response Number 1
Name: FBI Agent
Date: March 23, 2005 at 21:05:04 Pacific
Reply:

PHPs file_exists()

if you need any help on it just IM me on AIM or just repost it on here and i'll give you an example of a complete PHP file (assuming you dont know much PHP)

FBI Agent

AIM: EliteAssassin187


0

Response Number 2
Name: FishMonger
Date: March 24, 2005 at 08:28:33 Pacific
Reply:

http://us4.php.net/manual/en/function.get-headers.php


0

Response Number 3
Name: deadlydog
Date: March 24, 2005 at 08:59:33 Pacific
Reply:

Well, I tried using file_exists($URL); but that just returns false for everything, so I can't use that. And I was looking at the get_headers() function, but it's only available in PHP 5 and I'm still using 4.3.10. Any other suggestions? I might end up upgrading to PHP 5, I just hope I don't run into any problems and that everything will still work correctly.

Dan


0

Response Number 4
Name: FishMonger
Date: March 24, 2005 at 20:04:15 Pacific
Reply:

Personally, I prefer to usr Perl, I only use PHP when my boss insists, PHP is 10yrs behind Perl in its development.

Here's another PHP function that is compatible with PHP4.

http://us3.php.net/manual/en/function.get-meta-tags.php


0

Response Number 5
Name: FishMonger
Date: March 24, 2005 at 21:31:53 Pacific
Reply:

Here's another function that would be than the get_meta_tags and is compatible with PHP4.

http://us3.php.net/manual/en/function.header.php


0

Related Posts

See More



Response Number 6
Name: FishMonger
Date: March 24, 2005 at 21:34:39 Pacific
Reply:

Oops, forget that last one, it's for sending not retrieving the headers.


0

Response Number 7
Name: deadlydog
Date: March 30, 2005 at 10:58:28 Pacific
Reply:

Well, I tried using the get_meta_tags() function, but that took even longer than the fopen(), and it returned false for some sites that were up and running. Any other ideas? Thanks.

Dan

-- God is my favorite fictional character


0

Response Number 8
Name: deadlydog
Date: March 30, 2005 at 11:00:01 Pacific
Reply:

I'm open to trying other things to. If I was to try and do this with Perl, what would I need to do?

-- God is my favorite fictional character


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: How to check external URL exists

How to hide true URLs www.computing.net/answers/webdevel/how-to-hide-true-urls/3107.html

How to check site traffic? www.computing.net/answers/webdevel/how-to-check-site-traffic/3194.html

how to verify if a jpg truly exists www.computing.net/answers/webdevel/how-to-verify-if-a-jpg-truly-exists/2449.html