On 19 Mar 2001 06:53:00 -0800, [EMAIL PROTECTED] ("David G.") wrote: > Since fopen/fread/fclose all work with standard URLs, why not allow > file_exists() to work with URLs as well? > What is the procedure to make such a request? Try this: function url_exist($url) { $url_parts = parse_url($url); $fp = fsockopen($url_parts["host"], 80); if (!$fp) return false; $path = $url_parts["path")?$url_parts["path"]:"/"; fwrite($fp, "GET $path HTTP/1.0\r\n\r\n"); $response = fgets($fp, 500); preg_match("/^HTTP\/\d\.\d[ \t]+(\d+)[ \t]*([^\r]*)/", $response, $matches); switch ($matches[1]) { case 404: // HTTP error not found return false; case 200: // HTTP OK return true; default: return false; // other responses probably counts false } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]