$array = array( |
'Россия', |
'Белоруссия' |
); |
$out = '<select name="country">'; |
foreach($array as $v){ |
$out .= '<option value="'.rawurlencode($v).'">'.$v.'</option>'; |
} |
$out .= '</select>'; |
if(in_array($_POST['country'], $array)){ |
mysql_query('INSERT INTO `table` SET `country` = "'.$_POST['country'].'"'); |
} |