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
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?
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)
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.
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
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?
Summary: I’m a real beginner at building websites, so please bear with me if this is basic question. I’m currently trying to learn about creating URL’s that hide the true URL within hexadecimal codes and...
Summary: you should be able to access your web site's control panel (in many instances it is called cPanel) ... and you will find full stats available in there ask your web host how to access your site's contr...
Summary: hi everyone.. I've been trying to find a code that will verify if a file exists on a server. I found this code which works! however there is a but.. read below <?php $filename = 'http://randomdomai...