note 76416 added to function.get-headers

From: Date: Sat, 14 Jul 2007 02:25:15 +0000
Subject: note 76416 added to function.get-headers
Groups: php.notes 
Request: Send a blank email to php-notes+get-128512@lists.php.net to get a copy of this message
Be forewarned, none of the get_headers() functions below will replicate the behavior of PHP 5's get_headers() for URLs that use the 'Location:' redirect header or return File Not Found headers. According to RFC1945, A user agent should never automatically redirect a request more than 5 times, since such redirections usually indicate an infinite loop. For true compatibility, the functions below should be able to handle up to 5 Location redirects within one function call. Only the native get_headers() function exhibits this behavior. None of the functions below handle the 'Location' redirection. The native PHP >= 5 get_headers() function will not return headers in some instances where the functions below would. For example, if the server returns a 404 status, get_headers() will throw a PHP warning. Unfortunately, the 404 error can only be known by looking at the headers. From first glance, all of the functions below will return 404 headers, which may be a desired effect but does not replicate the behavior of the native get_headers() function. ---- Server IP: 216.194.113.175 Probable Submitter: 67.149.169.148 ---- Manual Page -- http://www.php.net/manual/en/function.get-headers.php Edit -- https://master.php.net/note/edit/76416 Del: integrated -- https://master.php.net/note/delete/76416/integrated Del: useless -- https://master.php.net/note/delete/76416/useless Del: bad code -- https://master.php.net/note/delete/76416/bad+code Del: spam -- https://master.php.net/note/delete/76416/spam Del: non-english -- https://master.php.net/note/delete/76416/non-english Del: in docs -- https://master.php.net/note/delete/76416/in+docs Del: other reasons-- https://master.php.net/note/delete/76416 Reject -- https://master.php.net/note/reject/76416 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128512) next »