RE: [PHP] Broken links report
| From: | Kjell Hansen | Date: | Tue, 03 Jun 2003 05:55:25 +0000 |
| Subject: | RE: [PHP] Broken links report | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149883@lists.php.net to get a copy of this message | ||
Thanx Chris,
this is exactly what I do. And I get
"Warning: fopen(http://www.whatever.com/index.html) [function.fopen]: failed
to create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"
I don't want to get the warning. I know I can switch it off but there are
other warnings I would like to see.
Somehow I just want to check for "HTTP/1.1 404 Object Not Found" and if
found show it as a broken link.
/Kjell
> -----Original Message-----
> From: Chris Kay [mailto:Chris.Kay@techex.com.au]
> Sent: Tuesday, June 03, 2003 08:48
> To: Kjell Hansen
> Subject: RE: [PHP] Broken links report
>
>
>
> Try
>
> $p = pOpen (http://www.whatever.com/index.html,"r")
>
> if ( $p ) {
> print("Worked");
> } else {
> print("Failed");
> }
>
> ---------------------------------------------------------
> Chris Kay
> Techex Communications
> Website: www.techex.com.au Email: chris.kay@techex.net.au
> Telephone: 1300 88 111 2 - Fax: 1300 882 221
> ---------------------------------------------------------
>
> -----Original Message-----
> From: Kjell Hansen [mailto:kjell.hansen@saj.fi]
> Sent: Tuesday, 3 June 2003 3:42 PM
> To: php-general@lists.php.net
> Subject: [PHP] Broken links report
>
> Hi,
> On a link page I have I'd like to show if the links are valid (=exists)
> I tried to do a pOpen (http://www.whatever.com/index.html,"r") and if it
> exists everything is fine but if it's not there I get a warning "failed
> to
> create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"
> Opening the file is actually not necessary, I'm checking for existence.
> But
> it's the only way I've found. Is there a better way to do this?
>
> I'm using PHP4 on a w2k workstation
>
> Thanx
> /Kjell
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>