Connecting Tech Pros Worldwide Help | Site Map

HTTP variables

  #1  
Old July 17th, 2005, 09:41 AM
dave
Guest
 
Posts: n/a
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, 09:41 AM
Steve
Guest
 
Posts: n/a

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, 09:45 AM
Nikolai Chuvakhin
Guest
 
Posts: n/a

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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session variables lost Erik answers 7 March 23rd, 2006 02:05 PM
Form HTTP post to password protected directory nyclamusician@gmail.com answers 2 November 22nd, 2005 04:08 AM
Dropped session variables tied to SSL pages? Or Redirect? Larry Woods answers 5 July 19th, 2005 02:12 PM
help http variables miganga77 answers 1 July 17th, 2005 06:34 AM