LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2006, 04:48 PM   #1
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
How to receive arbitrary HTTP posted XML data in a php script


Hi all,

I am trying to write a php script file that will be started as the result of a completely different application sending a TCP/IP message containing an HTTP POST request made up of XML formatted data to port 80 of a server. The post will specify the name of the php script file that should be executed to receive and process the XML data being sent, along with the actual XML data of course.

My problem is fairly simple. I am really not sure where to begin. The script really isn't a form with fixed action items, and the contents of the data can be dynamic.

I have tried googleing for anything having to do with posting XML data to php, and have encountered numerous articles saying how to use php to parse an XML file (close - but the data is coming in via the POST and not a local file), and how to use php to output XML formatted data (no brainer there). However I haven't been able to find any information saying what is involved in writing a php script to be the receiver of externally posted XML data.

Does anyone know of any tutorials or sample code that could assist me in solving my problem?

Thanks much!
-Bob Stewart
 
Old 03-09-2006, 05:42 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This sounds like AJAX, which uses javascript. I think something similar is mentioned on this webpage:
http://www.dynamicdrive.com/dynamici...jaxroutine.htm
Quote:
Ok, still using the original callback function above, processGetPost(), I'll show you a sample usage of using Ajax POST to send arbitrary information from the page to a PHP script asynchronously.
I found this with the Google search "php xml asynchronous"

Last edited by jschiwal; 03-09-2006 at 05:45 PM.
 
Old 03-10-2006, 11:36 AM   #3
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Original Poster
Rep: Reputation: 38
Thank you very much for responding jschiwal, unfortunately that example does not help me.

I don't have any problem generating, or sending the asynchronous XML data. I have a very generic sockets based client application that constructs the XML data, establishes a connection to the server's port 80, and sends the XML data as an HTTP POST. My problem is that I'm not sure how to code the server side of the conversation that responds to the asynchronous POST of the XML data using a php script. And unfortunately I must use php on the server side, as I am going to need to process the received XML data and update various mySql databases that reside on the server/host. Using php is the easiest way I can think of to do that.

Any other suggestions?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need to get data from xml file to MySQL database, and then use php to access Armon Linux - General 1 01-18-2006 02:54 PM
I must configure what to receive emails posted to me hicham007 Linux - Newbie 5 06-23-2005 03:47 PM
Paging data from XML with PHP Boby Programming 1 03-23-2005 09:57 AM
How do I access the request data POSTed by client? jayashrik Programming 3 03-04-2005 04:13 PM
using data posted by LQ-ers for an school asignment qanopus LQ Suggestions & Feedback 2 10-17-2003 08:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration