Re: Finding out which file is retrieved over HTTP
| From: | Jens Lehmann | Date: | Tue, 25 Mar 2003 12:08:20 +0000 |
| Subject: | Re: Finding out which file is retrieved over HTTP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140940@lists.php.net to get a copy of this message | ||
David Otton wrote:
On Sun, 23 Mar 2003 21:21:39 +0100, you wrote:The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.com/index.html. Is this possible and how?[...]
Maybe there are good standalone-link-checkers, but I need to integrate it in an application and my customer has some special wishes. Anyways I finished writing the link-checker. A thing which seemed a bit confusing to me is that if I open a non-existing website (fopen('http://www.amazon.de/nonsensestuff')) I always get an error message "Success". It's the same thing if I use file(). The manual explains that fopen() returns false if the website could not be opened, that's why I don't know why this error message appears? Besides this "Success"-message is surely a very bad error message. I use PHP 4.2.3. JensI need to write a small link-checker (Intranet), which reads in all links within a file and then looks if they're broken and collects some information. Unfortunately I didn't find a simple, free link-checker that's why I write my own. It would be good to find out the "complete" url, because I want to collect the file-endings (.php,.html, ...).I really think this already exists. You should probably search a bit harder.