oracle765 Posted July 19, 2019 Share Posted July 19, 2019 I have a holiday program which has suddenly stopped working, please see log file error and piece of code. Any ideas? ERROR LOG FILE [19-Jul-2019 09:46:53 UTC] PHP Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /home/ccuk/public_html/low-cost-holidays.php on line 877 [19-Jul-2019 09:46:53 UTC] PHP Warning: SimpleXMLElement::__construct(): EADSDatabaseError error raised, with message : Error 3011: Unknown identifier f in /home/ccuk/public_html/low-cost-holidays.php on line 877 [19-Jul-2019 09:46:53 UTC] PHP Warning: SimpleXMLElement::__construct(): ^ in /home/ccuk/public_html/low-cost-holidays.php on line 877 [19-Jul-2019 09:46:53 UTC] PHP Fatal error: Uncaught Exception: String could not be parsed as XML in /home/ccuk/public_html/low-cost-holidays.php:877 Stack trace: #0 /home/ccuk/public_html/low-cost-holidays.php(877): SimpleXMLElement->__construct('EADSDatabaseErr...') #1 {main} thrown in /home/ccuk/public_html/low-cost-holidays.php on line 877 and this is the code around line 877 865 if (isset($_GET['btnSearch'])) { // NEW SEARCH 866 $_SESSION['offers'] = []; 867 $tempOffers = []; 868 869 foreach ($urlArr as $provider => $ua) { 870 if ($ua['active']!=1) continue; 871 $search_url = $ua['url'].'?'; 872 $search_params['page'] = $ua['page']; 873 $path = $search_url . http_build_query($search_params); 874 file_put_contents('cacurl.txt', "$path\n", FILE_APPEND); 875 $rawxml = get_data($path); 876 if ($rawxml) { 877 $xml = new simpleXMLElement($rawxml); $providerOffers = $xml->xpath("//Offer"); foreach ($providerOffers as $po) { $po['logo'] = $ua['logo']; } $tempOffers = array_merge($tempOffers,$providerOffers); } } Quote Link to comment Share on other sites More sharing options...
Barand Posted July 19, 2019 Share Posted July 19, 2019 Looks to me like invalid XML - missing a "<" tag opene.r Quote Link to comment Share on other sites More sharing options...
oracle765 Posted July 19, 2019 Author Share Posted July 19, 2019 Thanks Barand for the prompt response Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.