note 65554 added to function.fopen
| From: | puneet at puneetarora dot com | Date: | Wed, 03 May 2006 10:25:05 +0000 |
| Subject: | note 65554 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-110440@lists.php.net to get a copy of this message | ||
Refering to the note by [info at b1g dot de]
on (24-Oct-2005 11:54)
sometimes you may also want HTTP error code returned from the server. The code of the HTTPRequest
class can be modified as followed to do so ..
1. Add another member variable to the class
var $_error; // HTTP Error code
2. After the lines
.
.
// parse headers
$headers = array();
$lines = explode($crlf, $header);
.
.
add
list($proto, $this->_error, $reply) = explode(" ", $lines[0]);
$proto and $reply can be treated as junk variables.
once DownloadToString() is called, the HTTP error code will be contained in the _error property of
the object.
----
Server IP: 203.199.107.94
Probable Submitter: 202.68.156.143
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/note/edit/65554
Del: integrated -- http://master.php.net/note/delete/65554/integrated
Del: useless -- http://master.php.net/note/delete/65554/useless
Del: bad code -- http://master.php.net/note/delete/65554/bad+code
Del: spam -- http://master.php.net/note/delete/65554/spam
Del: non-english -- http://master.php.net/note/delete/65554/non-english
Del: in docs -- http://master.php.net/note/delete/65554/in+docs
Del: other reasons-- http://master.php.net/note/delete/65554
Reject -- http://master.php.net/note/reject/65554
Search -- http://master.php.net/manage/user-notes.php