A
A
Art2019-08-10 17:43:25
API
Art, 2019-08-10 17:43:25

Error when accessing geohelper service API?

Hello!
The site has a pop-up window that informs the visitor about the country from which the last booking was made. The geohelper service is used for definition
Until recently, everything worked, now an error appears:
Notice: Undefined property: stdClass::$country in /home/u454544/rivierabus.com/www/wp-content/themes/rivierabus/footer.php on line 21
Notice: Trying to get property of non-object in /home/u454544/rivierabus.com/www/wp-content/themes/rivierabus/footer.php on line 21 Lines
21-26 contain the following code:
if($newtable [0]->phone != ''){$data = json_decode(file_get_contents(' http://geohelper.info/api/v1/phone-data?apiKey=Qkr...'.$newtable[0]->phone));$country_s = 'by client from '.$data->result->country->name.'.';}else{$country_s ='';}
?>
×
clock.png
The last reservation was made <?php echo $strDate;?>. <?php echo $country_s;?> Hurry up to book your seat on RivieraBus!
Tell me how to fix

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-08-11
@dimonchik2013

https://freelansim.ru/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question