Re: http message
| From: | (David) | Date: | Mon, 17 Dec 2001 19:42:27 +0000 |
| Subject: | Re: http message | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77987@lists.php.net to get a copy of this message | ||
use fsockopen
http://www.php.net/manual/en/function.fsockopen.php
to \"talk\" to the remote host.
>Is there a way for PHP to attempt to open a URL and return > the HTTP response header?
> For example, I want to make a PHP page which will redirect a visitor to a
> mirror site if it encounters a 404 Not found error whilst > trying to open the website
> homepage. This test page will reside on a seperate server.
> I was thinking maybe attempting to open the homepage with > something like fopen() and,
> using nested if() statements, > try the next mirror in the list
> if the fopen() command didnt succeed.
> Any ideas?