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

12 lines
506 B
PHP

<?php declare(strict_types=1); ?>
<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>