Page 1 of 1

get XML from outside server

Posted: Sat Apr 30, 2011 11:00 pm
by pc-moon
hello

hope all is well

i use php5

my code :

Code: Select all

	$xml = simplexml_load_file('http://feeds.bbci.co.uk/news/rss.xml?edition=int') ;
	
	 foreach($xml->channel->item as $key110 ){echo "<a href='".$key110->link."'><h3>".$key110->title."</h3></a><br>".$key110->description."<br>".$key110->pubDate."<hr>";}

also it's work on my computer

Re: get XML from outside server

Posted: Mon May 02, 2011 4:18 pm
by pickle
Did you have a question?

Re: get XML from outside server

Posted: Wed May 04, 2011 6:25 am
by pc-moon
yea i wanna ask

this code work well on my computer , but not work on host or server

i mean code get data from xml file of xml formate in localhost --> my computer

but not work on my web site , it's mean didn't read from another server

thank u

Re: get XML from outside server

Posted: Wed May 04, 2011 6:28 am
by eivind
Maybe your web host does not allow loading files outside of the web host?

Re: get XML from outside server

Posted: Wed May 04, 2011 6:58 am
by pc-moon
thank u so much

okey if server not allow what message is send , cause i don't know what is called to get data from another server

also i think my code need some code also , but i'm tiered , i tested curl but no resault

thank u again

Re: get XML from outside server

Posted: Wed May 04, 2011 3:27 pm
by McInfo
The ability of simplexml_load_file() and other functions to load remote content is affected by allow_url_fopen.