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

13 lines
506 B
PHP
Raw Normal View History

2023-07-17 19:15:18 +00:00
<?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>