473,387 Members | 1,512 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.

raw POST data

Is there a way to access the raw data sent to a PHP app via POST? I'm
trying to read the XML sent by a Flash program with XML.send() and its sent
via POST but not URL encoded. PHP is expecting URL encoding so it comes in
like:

$_POST['<?xml version'] = '"1.0"?>'

Perl can read it just fine like so:

read (STDIN, $rawpost, $ENV{'CONTENT_LENGTH'});
s/\&amp;/\&/g;

But since I'm a PHP kind of guy I'm wondering if there's a way to do this in
PHP.
Jul 16 '05 #1
1 24444
On Fri, 27 Jun 2003 18:57:35 GMT, "Roy Starkey" <rs******@austin.rr.com> wrote:
Is there a way to access the raw data sent to a PHP app via POST? I'm
trying to read the XML sent by a Flash program with XML.send() and its sent
via POST but not URL encoded. PHP is expecting URL encoding so it comes in
like:

$_POST['<?xml version'] = '"1.0"?>'

Perl can read it just fine like so:

read (STDIN, $rawpost, $ENV{'CONTENT_LENGTH'});
s/\&amp;/\&/g;

But since I'm a PHP kind of guy I'm wondering if there's a way to do this in
PHP.


Try the poorly documented $GLOBALS['HTTP_RAW_POST_DATA'] variable and the
always_populate_raw_post_data configuration directive in php.ini

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 16 '05 #2

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

Similar topics

5
by: Michael Foord | last post by:
I'm receiving POST data to a CGI, which I'd like to forward to another CGI using urllib2. I have two options - 1) Parse the data using cgi.FieldStorage() and then rebuild the POST request...
2
by: Erik Johnson | last post by:
I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
2
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
1
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
2
by: Ben | last post by:
Hi I have the two funcions below, login_web that posts data to a webpage and fcn_parseviewstate that parses the viewstate data for the post. I have a problem with the strPostData, I have been...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
5
by: manheim | last post by:
I have a page posting a raw jpg to me via HTTP POST. All reference I've found is centered around retrieving POST data as name/value pairs which will not work in this situation. What I need to do...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.