first
This commit is contained in:
54
table.php
Normal file
54
table.php
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Information table</title>
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th {
|
||||
padding: 10px;
|
||||
}
|
||||
td {
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
}
|
||||
tr:hover {background-color: #d6eeee}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$file = fopen("Information.txt", "r");
|
||||
function PrintStringOfTable($file)
|
||||
{
|
||||
$buf = fgets($file, filesize("Information.txt")); ?>
|
||||
<tr>
|
||||
<td> <?php echo $tok = strtok($buf, ";"); ?> </td>
|
||||
<td> <?php echo $tok = strtok(";"); ?> </td>
|
||||
<td> <?php echo $tok = strtok(";"); ?> </td>
|
||||
<td> <?php echo $tok = strtok(";"); ?> </td>
|
||||
<td> <?php echo $tok = strtok(";"); ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<caption>Инфрмацмонная таблица </caption>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<th>ФИО</th>
|
||||
<th>Дата рождения</th>
|
||||
<th>Пол</th>
|
||||
<th>Номер Телефона</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
<?php
|
||||
while (!feof($file)) {
|
||||
PrintStringOfTable($file);
|
||||
} // while
|
||||
?>
|
||||
</table>
|
||||
<?php fclose($file); ?>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user