Re: leaving UA trace when getting XML from URI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pobox@xxxxxxxxxxxxx wrote:
hello,

i wrote a small RSS reader using file_get_contents to get the XML from the URI - however i noticed that this does not leave trace (User Agent) in the remote server logs.

is there a way in PHP to get XML from URI and leave UA trace in the remote server logs?

thanks,
iv

Found it -

$options = array('http' => array('header'=>"User-Agent: foo bar"));

$context = stream_context_create($options);

$XML = file_get_contents($URI, NULL, $context);

Thanks anyway :o)
Iv

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux