How to collect the output

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
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

How to collect the output

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Uh, go again? You want to capture an XML file? Are you talking about downloading it?
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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]
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Is anybody there here
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Post 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!
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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). :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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!
Post Reply