<?php
header('Content-type: text/html; charset=utf8');
$users = array();
foreach (explode("\n", file_get_contents('login.txt')) as $row)
{
$users[] = explode(":", trim($row));
}
if (isset($_POST['del']))
{
echo('Uživatelé: ');
foreach ($_POST['del'] as $delIndex)
{
echo($users[$delIndex][0] . ',');
unset($users[$delIndex]);
}
echo(' byli smazáni');
}
echo('<form method="post">
<table>
<tr>
<th> </th><th>číslo</th><th>jméno</th><th>heslo</th>
</tr>');
foreach ($users as $n => $user)
{
echo('
<tr>
<td><input type="checkbox" name="del[]" value="' . $n . '"</td>
<td>' . ($n + 1) .'</td>
<td>' . $user[0] .'</td>
<td>' . $user[1] .'</td>
</tr>
');
}
echo('</table>
<input type="submit" name="delete" />
</form>');
Program byl vytvořen v roce 2012.