getting information from http header

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jayme Assuncao Casimiro

    getting information from http header


    How do I get the content of a http header named "test" in php?

    +---------------------------------------------+
    | Jayme Assuncao Casimiro |
    | Graduado em Ciência da Computação |
    | Estudante de Mestrado em Computação |
    | Universidade Federal de Minas Gerais - UFMG |
    +---------------------------------------------+
  • Prabhu

    #2
    Re: getting information from http header

    Hi,
    You can use the $_GET Array...
    for eg
    <?php

    $test = $_GET['test'];
    print $test;

    ?>

    -Prabhu

    Comment

    • Prabhu

      #3
      Re: getting information from http header

      Hi,

      Use the $_GET array...
      <?php
      $test = $_GET['test'];
      print test;
      ?>

      -Prabhu

      Comment

      • Prabhu

        #4
        Re: getting information from http header

        Hi,


        Use the $_GET array...
        <?php


        $test = $_GET['test'];
        print test;
        ?>

        -Prabhu

        Comment

        • Jayme Assuncao Casimiro

          #5
          Re: getting information from http header


          Is it in the same way that a get a parameter from a url?

          I know that if I wanna get the value of p1, which is passed as a parameter
          in the url I use $_GET['p1'].
          Example: http:www.teste.com.br?p1=xx




          On Fri, 29 Oct 2004, Prabhu wrote:
          [color=blue]
          > Hi,
          >
          >
          > Use the $_GET array...
          > <?php
          >
          >
          > $test = $_GET['test'];
          > print test;
          > ?>
          >
          > -Prabhu
          >
          >[/color]

          +---------------------------------------------+
          | Jayme Assuncao Casimiro |
          | Graduado em Ciência da Computação |
          | Estudante de Mestrado em Computação |
          | Universidade Federal de Minas Gerais - UFMG |
          +---------------------------------------------+

          Comment

          • Prabhu

            #6
            Re: getting information from http header

            Hi,


            Use the $_GET array...
            <?php


            $test = $_GET['test'];
            print $test;
            ?>

            -Prabhu

            Comment

            • Justin Koivisto

              #7
              Re: getting information from http header

              Jayme Assuncao Casimiro wrote:
              [color=blue]
              > How do I get the content of a http header named "test" in php?[/color]

              Check under the various $_SERVER['HTTP_*'] entries...

              <?php
              foreach($_SERVE R as $k=>$v)
              if(substr($k,0, 5)=='HTTP_')
              echo "$k : $v<br>";
              ?>

              The actual headers may vary depending on the server's software and os.

              --
              Justin Koivisto - spam@koivi.com

              Comment

              • Prabhu

                #8
                Re: getting information from http header

                HI,
                Sorry I misunderstood ur question...

                Try this

                <?php

                require_once('H TTP/Header.php');
                $header = new HTTP_Header('he aders');
                $test = $header->getHeader();
                foreach($test as $key=>$value)
                print $key.'=>'.$valu e.'</BR>';
                print $header->getHeader('con tent-type');
                ?>

                You have to install the HTTP_Header Pear package beforehand...
                Hope this helps..

                -Prabhu

                Comment

                • Chung Leong

                  #9
                  Re: getting information from http header

                  Jayme Assuncao Casimiro <jayme@dcc.ufmg .br> wrote in message news:<Pine.GSO. 4.58.0410291658 500.20838@vampi ra>...[color=blue]
                  > How do I get the content of a http header named "test" in php?
                  >
                  > +---------------------------------------------+
                  > | Jayme Assuncao Casimiro |
                  > | Graduado em Ci ncia da Computa o |
                  > | Estudante de Mestrado em Computa o |
                  > | Universidade Federal de Minas Gerais - UFMG |
                  > +---------------------------------------------+[/color]

                  See apache_request_ headers()

                  Comment

                  • R. Rajesh Jeba Anbiah

                    #10
                    Re: getting information from http header

                    Jayme Assuncao Casimiro <jayme@dcc.ufmg .br> wrote in message news:<Pine.GSO. 4.58.0410291658 500.20838@vampi ra>...[color=blue]
                    > How do I get the content of a http header named "test" in php?[/color]

                    Fetches all the headers sent by the server in response to an HTTP request


                    --
                    | Just another PHP saint |
                    Email: rrjanbiah-at-Y!com

                    Comment

                    Working...