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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> Telephone: 1300 88 111 2 - Fax: 1300 882 221
> ---------------------------------------------------------
>
> -----Original Message-----
> From: Kjell Hansen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 3 June 2003 3:42 PM
> To: [EMAIL PROTECTED]
> 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
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to