473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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=value 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.txt
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 ]
[ su*******@12jabber.com <--jabber IM ]

Jul 17 '05 #1
2 2524
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";

Jul 17 '05 #2
Sugapablo <ru**@REMOVEsugapablo.com> wrote:

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=value 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.txt
Content Length:1221


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, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Lisa Pearlson | last post by:
Hi, I have a php script with no more than this: <?php echo "Hello World!"; ?> When a webbrowser client requests data, it receives Apache server headers, followed by my data: HTTP/1.1 200...
2
by: vm | last post by:
Hi, for some reason my POST is not working properly. I am basically just trying to get a simple stock quote from yahoo by posting the ticker symbol (GE as an example) into finance.yahoo.com. ...
6
by: Phillip N Rounds | last post by:
I have a webform, from which I have to submit info to another site. Their instructions are to have a html form, with the following as the submit: <form method="post"...
3
by: C# Learner | last post by:
The following code gets the *body* of an HTTP message: <code> response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream(),...
14
by: Chris Fink | last post by:
Looking for some general design recommendations on an authentication scheme for B2B transactions inbound via an HTTP Post Listener ASPX page that reads the binary stream from the request body. I...
2
by: LD | last post by:
Hi, I am trying to upload a zip file and other form data elements to a server and get a response. The server keeps responding with Malformed Multipart Post. Can anyone see what might be wrong...
0
by: CFloyd | last post by:
I have a web service client that sends an XML string to the web service for processing. I alos have to add some headers to the post. I first establish the baseuri as === baseuri = new...
0
by: CFloyd | last post by:
I have a web service client that sends an XML string to the web service for processing. I alos have to add some headers to the post. I first establish the baseuri as === baseuri = new...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
3
by: webEater | last post by:
Hey, I am writing a file that reads in an external file in the web and prints it out including the response header of the http protocol. I do this to enable cross domain XMLHttpRequests. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.