PHP: loading XML in DOM from Database

zozii

New Member
For some reason this works flawlesly on my out of the box WAMP yet when uploaded to web server it drops the following error:\[quote\] Severity: Warning Message: DOMDocument::load(): I/O warning : failed to load external entity "/mounted-storage/home155/sub004/sc81961-YHHB/* * * * * *.com/dev/ 2012-10-04 03:15:03 4 2012-10-04 03:25:16 2012-09-17 19:25:11 3 0 1 1 2012-10-04 04:08:18 " Filename: models/fuel_model.php Line Number: 74\[/quote\]It's pointing to the applications root folder.Code:\[code\] function get_pos($id) { $get = $this->db->query( "SELECT * FROM holding WHERE id=1" ); $stream = $get->row_array(); $addr = 'http://api.eveonline.com/corp/StarbaseDetail.xml.aspx?keyID='.$stream['apiid']. '&vCode='.$stream['apikey'] . '&itemID=' . $id; $link = new DOMDocument(); $get_cache = $this->db->query( "SELECT * FROM cache_poses WHERE posid=".$id ); $cache = $get_cache->row_array(); $posted = strtotime(date("Y-m-d H:i:s")); if(!empty($cache)) { $posted = strtotime($cache['cachedon']); } $current = strtotime(date("Y-m-d H:i:s")); $mins = $posted - $current; $expiry = $mins % 60; if(empty($cache)) { $link->load($addr); $this->db->query("INSERT INTO cache_poses (data, posid) VALUES (" . $this->db->escape($link->saveXML()) . "," . $id .")"); } elseif(!empty($cache) && ($expiry >= 360)) { $this->db->query("DELETE FROM cache_poses WHERE posid=".$id); $link->load($addr); $this->db->query("INSERT INTO cache_poses (data, posid) VALUES (" . $this->db->escape($link->saveXML()) . "," . $id . ")"); } elseif(!empty($cache) && ($expiry < 360)) { $link->load($cache['data']); } $supply = $link->getElementsByTagName('row'); $supplies = array(); foreach ($supply as $fuel) { $block = $fuel->attributes; $put = $this->db->query('SELECT name FROM items WHERE typeid='.$block->item(0)->nodeValue); $lck = $put->row_array(); $supplies[$lck['name']] = $block->item(1)->nodeValue; } $info = $this->implode_with_keys($supplies); return $info; }\[/code\]
 
Back
Top