Page 1 of 1

How to collect the output

Posted: Wed Jan 24, 2007 1:53 am
by dude81
Hi all,

I've this strange problem, I pass a value on to a url, which ofcourse, uses GET Method to catch my value and it retruns me an output of xml, , Now My problem is to collect this xml which is now directly displayed on the browser. I dont know what file of which technolgy the other server responds.

How do I collect this information using php?


Thanks in Advance
Dude

Posted: Wed Jan 24, 2007 2:01 am
by RobertGonzalez
Uh, go again? You want to capture an XML file? Are you talking about downloading it?

Posted: Wed Jan 24, 2007 3:19 am
by dude81
Hi,

Yes, Im talking of downloading itself. You can compare the situation with payment gateway where two paramenters are returned. Here instead when I pass the URL , I get the XML output. I need to download this string to a file or can directly pass to my program.
[/b]

Posted: Wed Jan 24, 2007 3:30 am
by dude81
Ok, I tell you the problem very clearly. I've an application which on submission of a form it puts the data into database, if it finds a certain type of files say an image file, then it takes the image file and passes it to a server which takes the image path as its value
like

Code: Select all

http://server.com?img=http://localhost/pics/2.jpg
When I execute this, I get an xml output on to the browser. The output which is displayed as xml , I need it as a string or as a file.

Also One more doubt, how do I run the url through PHP. :roll:

Code: Select all

http://server.com?img=http://localhost/pics/2.jpg

Posted: Wed Jan 24, 2007 8:15 am
by dude81
Is anybody there here

Posted: Wed Jan 24, 2007 8:30 am
by kaszu
Using any of these will get the content of the web page (what xml basically is) if thats what you needed:
http://uk.php.net/curl (requires curl library)
http://uk.php.net/manual/en/function.fopen.php
http://uk.php.net/manual/en/function.fi ... ntents.php

Before posting next time please search the forum!

Posted: Wed Jan 24, 2007 9:00 am
by dude81
Great thanks, I was waiting for this answer. It really helped. Im bit weak in handling files becuase of the kind of usage it comes with always(very less usage). :)

Posted: Wed Jan 24, 2007 9:37 am
by feyd
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:4. All users of any level are restricted to bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
Waiting five hours is absurd. HAVE SOME PATIENCE!