pobject > pbookmark

methods

(bool)CheckLinkChecks if a URL is valid and exists.

CheckLink

(bool) CheckLink( $url = '' )

(string)$urlThe URL to check. If no URL is set, CheckLink uses the $value property of the pbookmark.

Returns TRUE if $url is valid, exists and is not permanently redirected or otherwise broken. If CheckLink returns false, you can check the exact problem by reading one of the following variables:

(int)$errorcodeAn error code from 1 to 10, see the list below.
(int)$errorseverityAn error severity from 1 to 10. Everything below 5 is a warning, above 5 is a permanent error. 5 is unknown.
(string)$errormessageA human readable error message, in English.

Error codes:

codeseveritydescription
11No URL entered.
21Unrecognized URL syntax.
310No DNS record for the hostname.
45Could not connect to FTP server.
55Could not connect to http server, or server returned an empty page.
62Link is redirected permanently: update the URL.
710Link is broken, server returned statuscode 4xx, 501, 502 or 505.
81Link is temporarily unavailable, server returned statuscode 500, 503 or 504.
95Server returned an unknown statuscode.
105Server returned an unparseable respons.