By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

HTTP variables

P: 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.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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

Jul 17 '05 #2

P: n/a
"dave" <dm*******@woh.rr.com> wrote in message
news:<E7******************@fe1.columbus.rr.com>...

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.


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

Cheers,
NC
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.