finita Posted December 13, 2006 Share Posted December 13, 2006 Hi,I have following problem:I'm getting xml data by html get method. For ex.http://www.somesite.com/index.php?i...hool=123&name=AWhen I send this info I'm getting response data as xmlNow my question and problem is:After getting this xml tree I want to parse it and write to db.Or after getting it I want to save somewhere in server as *.xml file.Is it possible? Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/ Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 [quote]Is it possible?[/quote]Yes. To both questions. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140118 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 [quote author=thorpe link=topic=118390.msg483783#msg483783 date=1165979998][quote]Is it possible?[/quote]Yes. To both questions.[/quote]how? Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140120 Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 Post your relevent code! Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140121 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 I have never such problem before. It is completely new for me.So I have any clue about this subject. That's why I asked for help from community members. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140127 Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 You say your already getting the data, all I need is to see how. It just makes it easier to explain.If you dont know how to get the data, your asking the wrong question. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140128 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 <?xml version="1.0" encoding="UTF-8"?><Auction><Branch id="1"><Category id="2"><Name>Gold</Name><Rings id="21"><Name>Special Gold Ring</Name><Product id="926395"><Process><AuctionData><Competitor ID="31" Type="1" country="US"><Name>James Miller</Name></Competitor><Competitor ID="102" Type="1" country="FR"><Name>Franck Pardeau</Name></Competitor><Competitor ID="22" Type="2" country="US"><Name>Linda Harwood</Name></Competitor></AuctionData><DateInfo><AuctionDate>2006-12-12 14:45:00</AuctionDate></DateInfo></Process><Status StatusId="1">Finished</Status><Result><Value Type="LAST" Currency="1">23,456.12</Value></Result><BidsHistory><Bids type="1" startingPrice="15,000" currency="1"><Bid Count="4" Rise="2,000">23,456.12</Bid><Bid Count="3" Rise="2,000">21,456.12</Bid><Bid Count="2" Rise="2,000">19,456.12</Bid></Bids></BidsHistory></Product></Rings></Category></Branch></Auction>This is the xml data which I'm getting by http get method.http://www.somesite.com/index.php?branch=1&Category=2&Date=2006-12-12 Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140147 Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 Post the code showing how you get this!!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140152 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 OK. I asked the question a little wrong I think.Now our information supplier has a form which gave us direct link to the file where I'm using to send form datas. I mean <form action="direct link to file out of my server" method="get">I meant I'm getting data by this way.So I'm asking after opposite server responded me the xml feed which I provided above, how can I generate, proceed this data with php? I want to parse and write to db or save it as xml file in my database.That's why I asked if it is possible. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140163 Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 Well, without seeing ANY code, I'll assume youve got this xml in a variable ($xml) somehow. To put it in a database...[code]INSERT INTO tbl (xml) VALUES ('$xml');[/code]To parse it, you will either need to look at php's [url=http://php.net/simplexml]simplexml[/url]extension for php5 or the [url=http://php.net/xml]xml[/url] otherwise. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140165 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 All right.Look at the little example given here:http://www.tbsistem.com/sampleWhen I click Submit, I'm getting the data like this one.I can save it as xml file from browser, but i dont want to do it like this.I want to save it auto somewhere in server and after saving run my cron to parse, generate it. Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140188 Share on other sites More sharing options...
Zane Posted December 13, 2006 Share Posted December 13, 2006 on the response.php pageyou need to give it an XML header and then it will automatically save so to speakI don't know how response.php works...like thorpe stressed, we need codebut on response.php you should putheader("Content-type: text/xml");and get rid of everything elseI.Ethe body tagthe html tagsthe meta tag Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140233 Share on other sites More sharing options...
finita Posted December 13, 2006 Author Share Posted December 13, 2006 Thanks for replies.I also do not know content of response.phpBut the content of response is completely xml Quote Link to comment https://forums.phpfreaks.com/topic/30431-proceed-data-obtained-by-http-get-method/#findComment-140303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.