Welcome Guest, Not a member yet? Register   Sign In
XML import from URL
#1

[eluser]Unknown[/eluser]
Hey guys,

I want to import an xml from the following URL;
http://api.eve-central.com/api/marketsta...m=30000142

the code i am using with codeigniter is
Code:
public function simple_reaction_price_import()
{
  $url = 'http://api.eve-central.com/api/marketstat?typeid=34&typeid=35&usesystem=30000142';
  $file = file_get_contents($url);
  $xml = simplexml_load_string($file);
   $data['info'] = $xml;
  $this->load->view('cron/test', $data);
}

//then using
print_r($info); // THis is used in the view
This code above i not returning any information but when i used the code below not with codeigniter it worked.
Code:
$url = 'http://api.eve-central.com/api/marketstat?typeid=34&typeid=35&usesystem=30000142';
$file = file_get_contents($url);
$xml=simplexml_load_string($file);
print_r($xml);

just wondering how i can get it to work with codeigniter.
I am new to frameworks and OOP programming any help would be nice




Theme © iAndrew 2016 - Forum software by © MyBB