HTTP Headers with POST?

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

    HTTP Headers with POST?

    How do I display all of the POST headers?

    What I want to see is all information related to a POSTed file and it's
    attributes, sort of like this:

    POST /file.php?var=va lue HTTP/1.0
    Host: www.domain.com:80
    Connection: Keep-Alive
    Content-Type: multipart/form-data; boundary=xxxxx
    Content-Description: form-data-1
    Content-Disposition: inline; filename=file.t xt
    Content Length:1221

    [Property File]
    This is the text of this file.
    This is the text of this file.
    This is the text of this file.
    This is the text of this file.
    This is the text of this file.
    This is the text of this file.


    --
    [ Sugapablo ]
    [ http://www.sugapablo.com <--music ]
    [ http://www.sugapablo.net <--personal ]
    [ sugapablo@12jab ber.com <--jabber IM ]

  • ZeldorBlat

    #2
    Re: HTTP Headers with POST?

    The $_FILES autoglobal is an associative array of items uploaded to the
    current script via HTTP POST. Try something like:

    while(list($key , $val) = each($_FILES))
    echo $key . ": " . $val . "\n";

    Comment

    • Tim Roberts

      #3
      Re: HTTP Headers with POST?

      Sugapablo <russ@REMOVEsug apablo.com> wrote:[color=blue]
      >
      >How do I display all of the POST headers?
      >
      >What I want to see is all information related to a POSTed file and it's
      >attributes, sort of like this:
      >
      >POST /file.php?var=va lue HTTP/1.0
      >Host: www.domain.com:80
      >Connection: Keep-Alive
      >Content-Type: multipart/form-data; boundary=xxxxx
      >Content-Description: form-data-1
      >Content-Disposition: inline; filename=file.t xt
      >Content Length:1221[/color]

      Assuming your PHP is running as an Apache module, apache_request_ headers()
      (or, its old name, getallheaders() ) should have what you want.

      If PHP is running as CGI, you'll need to parse the CGI environment
      variables to get this.
      --
      - Tim Roberts, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      Working...