我的代碼在 Chrome 瀏覽器中運行良好,但拒絕在其他瀏覽器中運行。
對于如何使它不僅適用于 Chrome 以及可能是我的錯誤的任何建議,我會很高興。
<?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>';
}
}
?>
uj5u.com熱心網友回復:
在對代碼不起作用的原因進行了長時間的澄清之后,事實證明整個問題在于不正確的服務器快取。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/472021.html
上一篇:Firefox(geckodriver):如何將JavaScript函式注入頁面,以便它們在從“executeScript”回傳時持續存在?
