Page 1 of 1
help & direction parsing xml
Posted: Fri Feb 25, 2005 3:52 am
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
Posted: Fri Feb 25, 2005 4:34 am
by n00b Saibot
Posted: Fri Feb 25, 2005 6:07 am
by snicolas
some example to pass the results of xml file into php variable will be good,,,
s
Posted: Fri Feb 25, 2005 7:13 am
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
Posted: Fri Feb 25, 2005 9:06 am
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
Posted: Fri Feb 25, 2005 9:32 am
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.
Posted: Fri Feb 25, 2005 9:53 am
by snicolas
it is actually already set to "on...
s
Posted: Fri Feb 25, 2005 9:58 am
by feyd
what version of php is this being run on? Post your code please.
Posted: Fri Feb 25, 2005 10:05 am
by snicolas
running on 4.3.9
Posted: Fri Feb 25, 2005 10:12 am
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
Posted: Mon Feb 28, 2005 3:52 am
by snicolas
so what kind of settings/rules should I configure on the firewall to allow access?
s