Notice: Trying to get property of non-object in /home/lyqan/public_html/index.php on line 2219
Fatal error: Unsupported operand types in /home/lyqan/public_html/index.php on line 2240
In my index.php code at line 2219
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
& at line 2240
$rW *= $rewardMultiplier;
Thanks.
not that guy, but I would assume
a) freegeoip.net is not returning expected json
b) no idea, looks like $rW or $rewardMultiplier is of wrong type (NULL? array?)
for first problem you can debug like this:
echo "User's ip: ". getIP() . "\n";
echo "Raw JSON: ". file_get_contents('http://freegeoip.net/json/' . getIP()) . "\n";
echo "decoded JSON: ". var_dump( json_decode(file_get_contents('http://freegeoip.net/json/' . getIP())). "\n";
first line should show user's ip, second should show json (something like "{ ... country_code: "GB" ... }"), third line should show object.