Get Parameter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
WingMaker
Forum Newbie
Posts: 3
Joined: Thu Apr 29, 2010 2:08 pm

Get Parameter

Post by WingMaker »

Hi All,

I need some help please, if someone is sending me an xml when they call my php file, how do I grab that xml file in my php code?

I need to get that file and parse it.

Any Ideas?

thanks
WING
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Get Parameter

Post by requinix »

Depends how they're sending it.

You probably want

Code: Select all

file_get_contents("php://stdin")
WingMaker
Forum Newbie
Posts: 3
Joined: Thu Apr 29, 2010 2:08 pm

Re: Get Parameter

Post by WingMaker »

This is how my partner would be sending it.

"I would make an HTTP POST request to an URL like http://server.com/shippinglabel.php. Thus I assume that an apache runs on a host and that it has an PHP module installed and that there exists a file shippinglabel.php that extracts the XML file from the HTTP request body and processes it. All information would be in the posted XML file, so there are no more URL parameters. We will use the following request header:

Content-Type: text/xml.
Accept: text/xml

Note that we will NOT use

Expect: 100-continue

Thus, the XML file will be sent with the request headers, not in a second transaction only after the apache server answered with a 100-continue HTTP status code.
We do this since we don't talk to an anonymous server over the Internet but expect the server to process the text/xml in any case."

let me know if you need more information

Thanks
WING
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Get Parameter

Post by requinix »

Then yes, the code I posted.
Post Reply