Re: header()

From: Date: Tue, 09 Jul 2002 19:25:20 +0000
Subject: Re: header()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-106437@lists.php.net to get a copy of this message
header() simply sends response headers - I.e adds/replaces server headers - it has no effect on request headers sent by the client. If, for some reason, you want to alter the user-agent you've received from the client (for testing maybe?) you can do this: echo $_SERVER['HTTP_USER_AGENT']; $_SERVER['HTTP_USER_AGENT']='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705)'; echo $_SERVER['HTTP_USER_AGENT']; HTH Danny ----- Original Message ----- From: "Taylor York" <taylor@dreamstargroup.com> To: <php-general@lists.php.net> Sent: Tuesday, July 09, 2002 4:54 PM Subject: [PHP] header() > I'm trying to change some information in the header...lets say that User > Agent for example...but it just wont change. > > putenv() will change the User Agent..but nothing else will > > <? > $ua = "Mozilla/4.0 (compatible;)"; > > header("User-Agent: $ua\n", TRUE); > header("Accept: */*", TRUE); > > //putenv("HTTP_USER_AGENT=$ua"); > > echo "\n<br>user agent: "; > echo getenv("HTTP_USER_AGENT"); > ?> > > Suggestions? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#106437) next »