servnest/pg-view/reg/select-domain.inc.php

12 lines
470 B
PHP
Raw Normal View History

<label for="domain"><?= _('Domain') ?></label>
<br>
<select required="" name="domain" id="domain">
<?php
$user_domains = regListUserDomains();
if (!in_array($_POST['domain'] ?? NULL, $user_domains, true))
echo ' <option value="" disabled="" selected="">—</option>' . LF;
foreach ($user_domains as $domain)
echo ' <option value="' . $domain . '"' . (($_POST['domain'] ?? NULL === $domain) ? ' selected=""' : '') . '>' . $domain . '</option>' . LF;
?>
</select>