HTTP variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dave

    HTTP variables

    Hello,
    I've got an issue with php4 that i suspect has to do with
    register_global s being off. I want to access the HTTP_* variables exported
    by apache. I would normally do this via:
    echo "$HTTP_USER_AGE NT";
    with register_global s 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.


  • Steve

    #2
    Re: HTTP variables


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

    RTFM:



    Use...

    print $_SERVER['HTTP_USER_AGEN T'];

    or for older PHPs...

    global $HTTP_SERVER_VA RS;
    print $HTTP_SERVER_VA RS['HTTP_USER_AGEN T'];

    ---
    Steve

    Comment

    • Nikolai Chuvakhin

      #3
      Re: HTTP variables

      "dave" <dmehler26@woh. rr.com> wrote in message
      news:<E7C3d.234 56$_z4.7331@fe1 .columbus.rr.co m>...[color=blue]
      >
      > I've got an issue with php4 that i suspect has to do with
      > register_global s being off. I want to access the HTTP_* variables
      > exported by apache. I would normally do this via:
      > echo "$HTTP_USER_AGE NT";
      > with register_global s 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_AGEN T'].

      Cheers,
      NC

      Comment

      Working...