|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-07 16:09 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 15:00:01 2025 UTC |
Hello, In my php project (phpDig, a small robot/search engine), i needed to send "Cookie: ..." HTTP header when i use the file() function with http fopen_wrappers. I needed this in order to spider sites setting cookies (session, selected language, etc...). The only solution i found was inserting my custom headers in the ini constant "user_agent" with ini_set. This works, but i mean that could be removed in an future release of PHP : ini_set('user_agent','phpdig/1.6'."\n".'Cookie: foo=bar'."\n".'Cookie: bar=foo'); Of course, setting other client headers in "user_agent" is not very good. I suggest to add another ini constant ("http_client_headers" ?) that will contain those headers. I mean it would be useful. Best regards, Antoine Bajolet