Change user agent when using file() or fopen()
| From: | David Yee | Date: | Thu, 29 Aug 2002 07:34:28 +0000 |
| Subject: | Change user agent when using file() or fopen() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114474@lists.php.net to get a copy of this message | ||
How do I change the "browser" name and version presented to the target web
server when I use file() or fopen()? E.g.
<?php
$content = file('http://foo.bar/foo.html');
?>
The access_log for the web server will show something like:
127.0.0.1 - - [29/Aug/2002:00:08:59 -0700] "GET /foo.html HTTP/1.0" 404 45
"-" "PHP/4.2.2"
I want to change "PHP/4.2.2" to something like "Mozilla/4.0 (compatible;
MSIE 5.01; Windows NT)".
I looked in php.ini but couldn't find a setting for this. Anyone know where
to set this? Thanks.
David