array(7) { ["name"]=> string(9) "ferrum.ru" ["alias"]=> string(24) "ServerAlias argentum.com" ["charset"]=> string(5) "UTF-8" ["email"]=> string(9) "zirc@a.ru" ["indexfiles"]=> string(20) "index.php index.html" ["save"]=> string(37) "Сохранить изменения" ["data"]=> array(5) { [3]=> array(4) { ["email"]=> string(8) "dd@dd.ru" ["indexfiles"]=> string(20) "index.php index.html" ["alias"]=> string(15) "ServerAlias ddd" ["charset"]=> string(5) "UTF-8" } [4]=> array(4) { ["email"]=> string(9) "zirc@a.ru" ["indexfiles"]=> string(20) "index.php index.html" ["alias"]=> string(23) "ServerAlias argentum.ru" ["charset"]=> string(5) "UTF-8" } [5]=> array(4) { ["email"]=> string(14) "admin@rovel.ru" ["indexfiles"]=> string(20) "index.php index.html" ["alias"]=> string(19) "ServerAlias zinc.ru" ["charset"]=> string(5) "UTF-8" } [6]=> array(4) { ["email"]=> string(14) "admin@rovel.ru" ["indexfiles"]=> string(20) "index.php index.html" ["alias"]=> string(19) "ServerAlias zinc.ru" ["charset"]=> string(5) "UTF-8" } [9]=> array(4) { ["email"]=> string(13) "email@mail.ru" ["indexfiles"]=> string(20) "index.php index.html" ["alias"]=> string(21) "ServerAlias google.ru" ["charset"]=> string(5) "UTF-8" } } }
<?php
$user = 'u1';
$dbtable = 'vhosts_kp';
$connection = mysqli_connect('localhost', '***', '***', '***');
$list = mysqli_query ($connection, "SELECT name FROM $dbtable WHERE userid = '$user' ");
$listarr = mysqli_fetch_array ($list);
?>
<html>
<body>
<form method = "post">
<span>Сайт</span>
<select>
<?php while($data = mysqli_fetch_array($list)) {
echo "<option value = '{$data['name']}'>{$data['name']}</option>";
}
?>
</select>
</form>
</body>
</html>
<?php
$user = 'u1';
$dbtable = 'vhosts_kp';
$connection = mysqli_connect('localhost', 'xxx', 'xxx', 'xxx');
$list = mysqli_query ($connection, "SELECT name FROM $dbtable WHERE userid = '$user' ");
$listarr = mysqli_fetch_array ($list);
?>
<html>
<body>
<form method = "post">
<span>Сайт</span>
<select>
<?php while($data = mysqli_fetch_array($listarr)) {
echo "<option>{$data['name']}</option>";
}
?>
</select>
</form>
</body>
</html>
<html>
<body>
<form method = "post">
<span>Сайт</span>
<select>
</select>
</form>
</body>
</html>
<?php
ini_set('error_reporting', E_ALL);
$user = 'u1';
$dbtable = 'vhosts_kp';
$connection = mysqli_connect('localhost', '***', '***, '***');
$wwwlist = mysqli_query ($connection, "SELECT * FROM $dbtable WHERE userid = '$user' ");
$list = mysqli_query ($connection, "SELECT name FROM $dbtable WHERE userid = '$user' ");
$data = mysqli_fetch_array($wwwlist);
$listarr = mysqli_fetch_array ($list);
$list = mysqli_query ($connection, "SELECT name FROM $dbtable WHERE userid = '$user' ") or die('Something wrong!');
echo '<b>Мои сайты</b>';
// выводим на страницу сайта заголовки HTML-таблицы
echo '<table border="1">';
echo '<thead>';
echo '<tr>';
echo '<th>Сайт</th>';
echo '<th>Email администратора</th>';
echo '<th>Индексные файлы</th>';
echo '<th>Алиасы</th>';
echo '<th>Кодировка домена</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
// выводим в HTML-таблицу все данные клиентов из таблицы MySQL
while($data = mysqli_fetch_array($wwwlist)){
echo '<tr>';
echo '<td>' . $data['name'] . '</td>';
echo '<td><textarea name = "data[' . $data ['unid'] . '][email]">' . $data ['email'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][indexfiles]">' . $data ['indexfiles'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][alias]">' . $data ['alias'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][charset]">' . $data ['charset'] . '</textarea></td>';
echo '</tr>';
}
?>
<html>
<body>
<form method = "post">
<span>Сайт</span>
<select>
<?php while($data = mysqli_fetch_array($listarr)) {
echo "<option>{$data['name']}</option>";
}
?>
</select>
</form>
</body>
</html>
<b>Мои сайты</b><table border="1"><thead><tr><th>Сайт</th><th>Email администратора</th><th>Индексные файлы</th><th>Алиасы</th><th>Кодировка домена</th></tr></thead><tbody><tr><td>admin</td><td><textarea name = "data[3][email]">dd@dd.ru</textarea></td><td> <textarea name = "data[3][indexfiles]">index.php index.html</textarea></td><td> <textarea name = "data[3][alias]">ServerAlias ddd</textarea></td><td> <textarea name = "data[3][charset]">UTF-8</textarea></td></tr><tr><td>ferrum.ru</td><td><textarea name = "data[4][email]">zirc@a.ru</textarea></td><td> <textarea name = "data[4][indexfiles]">index.php index.html</textarea></td><td> <textarea name = "data[4][alias]">ServerAlias argentum.ru</textarea></td><td> <textarea name = "data[4][charset]">UTF-8</textarea></td></tr><tr><td>arg.ru</td><td><textarea name = "data[5][email]">admin@rovel.ru</textarea></td><td> <textarea name = "data[5][indexfiles]">index.php index.html</textarea></td><td> <textarea name = "data[5][alias]">ServerAlias zinc.ru</textarea></td><td> <textarea name = "data[5][charset]">UTF-8</textarea></td></tr><tr><td>arg.ru</td><td><textarea name = "data[6][email]">admin@rovel.ru</textarea></td><td> <textarea name = "data[6][indexfiles]">index.php index.html</textarea></td><td> <textarea name = "data[6][alias]">ServerAlias zinc.ru</textarea></td><td> <textarea name = "data[6][charset]">UTF-8</textarea></td></tr><tr><td>gogol.ru</td><td><textarea name = "data[9][email]">email@mail.ru</textarea></td><td> <textarea name = "data[9][indexfiles]">index.php index.html</textarea></td><td> <textarea name = "data[9][alias]">ServerAlias google.ru</textarea></td><td> <textarea name = "data[9][charset]">UTF-8</textarea></td></tr><html>
<body>
<form method = "post">
<span>Сайт</span>
<select>
</select>
</form>
</body>
</html>