additional headers in include and require functions
| From: | Adam Kropielnicki | Date: | Fri, 05 May 2000 07:42:05 +0000 |
| Subject: | additional headers in include and require functions | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14505@lists.php.net to get a copy of this message | ||
Hi
This is a patch file wich fixes a fopen-wrappers.c file in PHP-4.0RC1.
This patch gives possibility to adding several headers in request to server of
include add require functions. It works only with http protocol.
How does it works:
User have to define a associative array called http_heads with new headers.
If a standard header (Host, User-Agent, From, Authorization) is predefined -
a predefined one will be sent, otherwise a stadard one will be added to the request.
For example, this code:
$http_heads["User-Agent"]="patched PHP";
$http_heads["My head"]="adasz";
$http_heads["My head2"]="adasz2";
include("http://adasz.cnt.pl/gethead.php3");
will send a request of gethead.php3 file to adasz.cnt.pl server with
following headers:
Host: adasz.cnt.pl - standard header
My head: adasz - added header
My head2: adasz2 - added header
User-Agent: patched PHP - standard predefined header
This is very important ability for me and I'would be very contented if
this patch will be included in standard edition of PHP.
What do you think about it - write if I should do some corrections.
I also want to add possibility of using proxy servers with include
and require functions.
--
Adam
--
_/ _/ _/_/_/ ----- Adam Kropielnicki, adasz@wp.pl -----
_/ _/ _/ _/ _/ Wirtualna Polska SA http://www.wp.pl
_/_/_/_/ _/_/_/
_/ _/ _/ --------==* Moja WP: http://moja.wp.pl
*==----------
Attachment: [text/x-c] fopen-include.patch
Attachment: [text/x-c] fopen-include.patch