Ответ 1
Используйте PHP GeoIP API. ПРИМЕЧАНИЕ. Перед использованием функций вам необходимо настроить базу данных Maxmind GeoIP API.
<select name="securityqustion" class="securityqustion" id="security_qustion">
<?php
// will resolve 2-character ISO country code
$request_country = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
$countries = array("DE" => "Germany", "FR" => "France", ...); // define list
foreach ($countries as $country_code => $country_label) {
if ($request_country == $country_code)
$selected = "selected"
else
$selected = "";
echo "<option value=\"{$country_code}\" {$selected}>{$country_label}</option>\n";
}
?>
</select>