Ask a Question related to PHP Development, Design and Development.
-
Paul Schmidinger #1
Detecting Dead Links
Hi,
I have a number of Links (coming from a database, but that does not matter)
and I want to check using a PHP-script if they "work" or if they are "dead"
(error 404 or something like that).
Now, what happens if I use fopen() to test a dead link? Do I get an error
(that would be good) or do I get the Error404-HTML-Page from the webserver
and can not determine if it is a "valid" page or just the Error-Page?
Does anyone have an idea how to test for dead links using PHP?
Thanks,
Paul
[url]www.eigelb.at[/url]
Paul Schmidinger Guest
-
Netscape and dead links
State the Pub version being used, the version of NS tested, the URL of the site. -- David Bartosik - MS MVP www.publishermvps.com "islander"... -
check for dead links
I have a database with hundreds of urls Is there a quick way to validate these links and to get a report with the dead links... thx! dany -
DEAD MAC! - HELP!!!
Hey Group... Any suggestions would be greatly appreciated!!! My home computer just died this past weekend....It's a Mac G3 Desktop 266mHz... -
detecting links
Is there any simple way to determine if a reference returned via readdir is a soft- or hardlink rather than a directory or filename. None of my... -
Dead DNS
My Solaris 9 box will not resolve any addresses. It is DHCP and the resolv.conf has not changed. I've tried releasing the IP and rebooted.. no... -
Alvaro G Vicario #2
Re: Detecting Dead Links
*** Paul Schmidinger wrote/escribió (Fri, 25 Jun 2004 12:58:43 +0200):
You have to check the headers returned by the server, not the page itself.> Now, what happens if I use fopen() to test a dead link? Do I get an error
> (that would be good) or do I get the Error404-HTML-Page from the webserver
> and can not determine if it is a "valid" page or just the Error-Page?
They look like this:
HTTP/1.1 200 OK
Date: Fri, 25 Jun 2004 11:00:24 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftOfficeWebServer: 5.0_Pub
Content-Length: 750
Content-Type: text/html
Cache-Control: private
Age: 2
Please note the numeric code in the first line (in this example, 200),
that's the useful info. Please note it can be a redirect code--that's what
you send to client when you use header('Location: http//.....') in your
scripts.
As about the best way to check the HTTP status code, I don't have any
experience. However, I believe the chapter "CURL, Client URL Library
Functions" in PHP docs can be what you need.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Alvaro G Vicario Guest
-
Paul Schmidinger #3
Re: Detecting Dead Links
Thanks a lot, that should do it!
Paul Schmidinger
[url]www.eigelb.at[/url]
"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> schrieb im
Newsbeitrag news:shhqbr09g9zx.143by67nrce7p$.dlg@40tude.net...error> *** Paul Schmidinger wrote/escribió (Fri, 25 Jun 2004 12:58:43 +0200):> > Now, what happens if I use fopen() to test a dead link? Do I get anwebserver> > (that would be good) or do I get the Error404-HTML-Page from the>> > and can not determine if it is a "valid" page or just the Error-Page?
> You have to check the headers returned by the server, not the page itself.
> They look like this:
>
> HTTP/1.1 200 OK
> Date: Fri, 25 Jun 2004 11:00:24 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> MicrosoftOfficeWebServer: 5.0_Pub
> Content-Length: 750
> Content-Type: text/html
> Cache-Control: private
> Age: 2
>
> Please note the numeric code in the first line (in this example, 200),
> that's the useful info. Please note it can be a redirect code--that's what
> you send to client when you use header('Location: http//.....') in your
> scripts.
>
> As about the best way to check the HTTP status code, I don't have any
> experience. However, I believe the chapter "CURL, Client URL Library
> Functions" in PHP docs can be what you need.
>
>
> --
> --
> -- Álvaro G. Vicario - Burgos, Spain
> --
Paul Schmidinger Guest



Reply With Quote

