Posts: 36
Name: Greta
Location: Winchestertonfieldville
|
I'm grabbing an xml doc from the web, picking it apart and spitting it out in my own site. It works great in IE and FF, but for some reason it's throwing me an error in Safari...
Here's the error:
A PHP Error was encountered
Severity: Warning
Message: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 2209: parser error : Start tag expected, '<' not found
Filename: libraries/thingy.php
Line Number: 30
Here's the code:
PHP Code:
function HTTPRequest($url) { $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //curl_setopt($ch,CURLOPT_MUTE,1); curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]); curl_setopt($ch, CURLOPT_TIMEOUT, 10); //times out after 10 curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); $data = curl_exec ($ch); curl_close ($ch); return $data; } function GetXML() { $xmlID = $this->HTTPRequest("some.xml"); $xml = new SimpleXMLElement($xmlID); // <--- line 30 return $xml; }
Anyone know why Safari is bugging out?
Last edited by Rusalka; 10-13-2008 at 08:25 PM..
|