help & direction parsing xml

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
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

help & direction parsing xml

Post by snicolas »

Hi all!...

it's friday..thx g.d!

Ok, my objectif todayis to be able to read a xml file on a remotre server and display it's information in a select list.
I am posting a $value using a php form and querying the remote server with this value.
This server shoudl return me with a list of results in xml format.
I need to display the results in thelist...

HELP!!!!!!!!!!!!!!!!!

s
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

some example to pass the results of xml file into php variable will be good,,,

s
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

i think the manual is filled with examples.....


here is one to parse xml into an array
http://timvw.madoka.be/programming/php/xml2array.txt

and here is one that does more traditional parsing
http://timvw.madoka.be/programming/php/service.txt
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

ok, I am getting there slowly....

I have a strange problem.

When trying to access a xml file on a remote server using fopen(http://theaddress of the xml), i am returned with :
Warning: fopen(http://...........) Bad file descriptor.

But if I download the xml file locally (exactely the same from the url above) and link it directly in my code as:
fopen(xmlfile.xml) it works fine..

any suggestions?

s
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

From PHP Manual...
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.
you need to turn allow_url_fopen to on in php.ini.
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

it is actually already set to "on...

s
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what version of php is this being run on? Post your code please.
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

running on 4.3.9
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Please post your code. Google has several threads regarding such an error and firewalls clashing.. http://www.google.com/search?hl=en&q=%2 ... +fopen+php
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

so what kind of settings/rules should I configure on the firewall to allow access?

s
Post Reply