Home > Blockchain >  PHP script only works in Chrome
PHP script only works in Chrome

Time:05-05

I have a code that works fine in Chrome browser but refuses to work in other browsers.

I would be glad for any advice on how to make it work not only for Chrome and what could be my mistake.

<?php
$geoplugin = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $_SERVER['REMOTE_ADDR']) );
if ( is_numeric($geoplugin['geoplugin_latitude']) && is_numeric($geoplugin['geoplugin_longitude']) && !is_user_logged_in() ) {
    $lat = $geoplugin['geoplugin_latitude'];
    $long = $geoplugin['geoplugin_longitude'];
if ($geoplugin['geoplugin_countryCode'] == 'US') {
    echo '<a href="#" >Title</a>';
}
}
?>

CodePudding user response:

After a long clarification of the reasons why the code does not work, it turned out that the whole problem was in incorrect server caching.

  • Related