Jump to content

oracle765

Members
  • Content Count

    215
  • Joined

  • Last visited

Community Reputation

1 Neutral

About oracle765

  • Rank
    Advanced Member
  1. Thanks Barand for the prompt response
  2. 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); } }
  3. ok thanks Barand I will look into this, as you are probably already aware they are in an ini file which sets them to active or none active for each holiday provider, and if i keep adding them it keeps getting slower I will look into this ajax call to see if i can run in parallel many thanks
  4. hi ginerjm I dont know what you mean by that many thanks
  5. hi yes ginergem All travel agents provide the same url structure from the same api provider and take around the same time to return
  6. Hi Guys We have had a holiday program written in php in the past by an experienced developer but we are experiencing problems now. So I am curious to try and resolve the best approach Here goes 1: We query multiple APIs to return holiday results to our users 2: This can take up to 20 seconds to return results but sometimes its much quicker depending on the volume of API returned results 3: Other users seem to be locked out of even visiting our website if an API call is running So initially without posting any code, I have a couple of questions which are A: Is there a way to maybe poll a process or allow partial results to the users browser while things run in the background ( similar to what other holiday providers seem to be doing ) B: Is there a way to speed this up or maybe some sort of better technology to utilise Many thanks professionals
  7. ok update managed to get the port open and it works fine now... thanks for the advice
  8. hi there I have tried that and get this error Fatal error: Uncaught Exception: String could not be parsed as XML in /home/ccuk/public_html/holiday-test.php:18 Stack trace: #0 /home/ccuk/public_html/holiday-test.php(18): SimpleXMLElement->__construct('') #1 {main} thrown in /home/ccuk/public_html/holiday-test.php on line 18
  9. I am looking for someone on a short term basis to extract information from an API we have access too
  10. I see no output still this is what i now have ini_set("display_errors", 1); error_reporting(E_ALL); $holidays_url="http://87.102.127.86:8103/search/searchoffers.dll?page=Resort&countryid=7"; $holidays_curl = curl_init($holidays_url); curl_setopt($holidays_curl, CURLOPT_ENCODING, "gzip"); curl_setopt($holidays_curl, CURLOPT_URL, $holidays_url); curl_setopt($holidays_curl, CURLOPT_RETURNTRANSFER, true); $debugme=curl_exec($holidays_curl); echo $debugme; exit(); //$holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl)); $holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl),null,true); $holidays_stdclass=json_decode(json_encode($holidays_xml)); echo "<pre>"; print_r($holidays_stdclass); and not even an error message now? i know when i click the url i can see results but can seem to extract info from it
  11. ok i have this now ini_set("display_errors", 1); error_reporting(E_ALL); $holidays_url="http://87.102.127.86:8103/search/searchoffers.dll?page=Resort&countryid=7"; $holidays_curl = curl_init($holidays_url); curl_setopt($holidays_curl, CURLOPT_ENCODING, "gzip"); curl_setopt($holidays_curl, CURLOPT_URL, $holidays_url); curl_setopt($holidays_curl, CURLOPT_RETURNTRANSFER, true); //$holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl)); $holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl),null,true); //echo $feed->SHOPITEM[0]->ID_PRODUCT; $holidays_stdclass=json_decode(json_encode($holidays_xml)); echo "<pre>"; print_r($holidays_stdclass); i am getting error message SimpleXMLElement::__construct(): I/O warning : failed to load external entity "" in /home/ccuk/public_html/holiday-test.php on line 53 Fatal error: Uncaught Exception: String could not be parsed
  12. ah sorry never realised it had to be in front
  13. $holidays_url="http://87.102.127.86:8103/search/searchoffers.dll?page=Resort&countryid=7"; $holidays_curl = curl_init(); curl_setopt($holidays_curl, CURLOPT_ENCODING, "gzip"); curl_setopt($holidays_curl, CURLOPT_URL, $holidays_url); curl_setopt($holidays_curl, CURLOPT_RETURNTRANSFER, true); $holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl)); $holidays_stdclass=json_decode(json_encode($holidays_xml)); error_reporting(E_ALL); ini_set("display_errors", 1); echo "<pre>"; print_r($holidays_stdclass); This still shows a blank screen
  14. hi there nothing it is blank screen
  15. I am trying to extract data from an API and not to sure where I am going wrong or even doing it correctly for that matter. Initally I cannot even print out the URL values Any help would be greatly appreciated professionals. here is my code, i know the url works in the browser address bar <?php $holidays_url="http://87.102.127.86:8103/search/searchoffers.dll?page=Resort&countryid=7"; $holidays_curl = curl_init(); curl_setopt($holidays_curl, CURLOPT_ENCODING, "gzip"); curl_setopt($holidays_curl, CURLOPT_URL, $holidays_url); curl_setopt($holidays_curl, CURLOPT_RETURNTRANSFER, true); $holidays_xml = new SimpleXMLElement(curl_exec($holidays_curl)); $holidays_date = DateTime::createFromFormat("Y-m-d", $startdate); $holidays_link=$holidays_xml; $holidays_stdclass=json_decode(json_encode($holidays_xml)); echo "<pre>"; print_r($holidays_xml); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.