473,395 Members | 1,823 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,395 software developers and data experts.

Posting Raw XML to PHP?

I want to post a XML file to a PHP program. I have seen programs using
the following curl format to send the XML:
curl =H"POST / HTTP/1.0 Content-Type:
application/x-www-form-urlencoded Content-Length: 12 " -d"<top></top>"
However, I am not sure what to code on the PHP end to accept the XML.
I checked $_POST and it is empty. I know you can send the data by
posting to a var, like ( -d"xml=\"<top></top>\"").

Thanks
Nov 13 '06 #1
1 2050
David wrote:
I want to post a XML file to a PHP program. I have seen programs using
the following curl format to send the XML:
curl =H"POST / HTTP/1.0 Content-Type:
application/x-www-form-urlencoded Content-Length: 12 " -d"<top></top>"
However, I am not sure what to code on the PHP end to accept the XML.
I checked $_POST and it is empty. I know you can send the data by
posting to a var, like ( -d"xml=\"<top></top>\"").

Thanks
Try checking $HTTP_RAW_POST_DATA.

Alternatively, you could use file_get_contents("php://stdin") if your
PHP install supports it.

I would also specify the correct content-type for my POST message
("text/xml"), but I've never done it so maybe there's some reason why
you're not doing that.

Jeremy
Nov 14 '06 #2

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

Similar topics

145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
2
by: Jonathan M. Rose | last post by:
I am looking for a script that I can sit on an HTML server (Linux, Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things: 1) Post news articles that consists of (i) a title...
21
by: Davinder | last post by:
can anyone recommend a good tool to convert documents to HTML on the fly. I need to integrate this tool with a VB app so it must have an API. thanks in advance Davinder davinder@gujral.co.uk
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
54
by: Brett Baisley | last post by:
Hello, I am trying to figure out how to change the default font-family and font-size. I tried adding this to the BODY section, but it didn't work. I tried to the P section, but they are not...
33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
3
by: Roger Walter | last post by:
I have a .Net web page that is posting twice after the submit button is clicked once. How can that happen? I have turned tracing on and it writes two records to the trace log and posts twice. ...
2
by: m | last post by:
Hi All, I m extremely sorry if this is the wrong place to post it but i just need some info on the MS Posting Acceptor. 1) Is MS Posting Acceptor available with IIS5.0 and above. 2)If so where...
44
by: Bruce Wood | last post by:
This subject has come up several times in this group over the last year. Several people in this group seem to feel strongly about this topic. Rather than derail other threads with this discussion,...
27
by: Alan T | last post by:
I am not sure which way to go: Want to learn C# but C# is implemented both in Windows desktop application and ASP.NET. I am not familiar with web programming, should I start with Windows app or...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.