Connecting Tech Pros Worldwide Help | Site Map

HTTP variables

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 08:41 AM
dave
Guest
 
Posts: n/a
Default HTTP variables

Hello,
I've got an issue with php4 that i suspect has to do with
register_globals being off. I want to access the HTTP_* variables exported
by apache. I would normally do this via:
echo "$HTTP_USER_AGENT";
with register_globals off this isn't working. This request isn't part of a
form so the $_GET and $_POST arrays won't have it. According to phpinfo()
the variable is being set i am unable to find it. Any help appreciated.
Thanks.
Dave.



  #2  
Old July 17th, 2005, 08:41 AM
Steve
Guest
 
Posts: n/a
Default Re: HTTP variables


Must be my turn for the obligatory daily RTFM request...

RTFM:

http://www.php.net/reserved.variables

Use...

print $_SERVER['HTTP_USER_AGENT'];

or for older PHPs...

global $HTTP_SERVER_VARS;
print $HTTP_SERVER_VARS['HTTP_USER_AGENT'];

---
Steve

  #3  
Old July 17th, 2005, 08:45 AM
Nikolai Chuvakhin
Guest
 
Posts: n/a
Default Re: HTTP variables

"dave" <dmehler26@woh.rr.com> wrote in message
news:<E7C3d.23456$_z4.7331@fe1.columbus.rr.com>...[color=blue]
>
> I've got an issue with php4 that i suspect has to do with
> register_globals being off. I want to access the HTTP_* variables
> exported by apache. I would normally do this via:
> echo "$HTTP_USER_AGENT";
> with register_globals off this isn't working. This request isn't part of a
> form so the $_GET and $_POST arrays won't have it.[/color]

Sure, but the $_SERVER will... Try $_SERVER['HTTP_USER_AGENT'].

Cheers,
NC
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.