Files/index.php
2025-04-23 09:15:00 +02:00

39 lines
1.2 KiB
PHP

<!DOCTYPE html>
<!--
/*
* smzint/Files (c) schmamazon.com 2025
*/
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>smzint/Files</title>
</head>
<body>
<h1>Available Files</h1>
<ul>
<?php
include('../Auth/db.ini.php');
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM smz_files_data WHERE public='1'";
$result = $conn->query($sql);
$conn->close();
if ($result->num_rows > 0) {
echo "<table>";
while ($row = $result->fetch_assoc()) {
echo "" . $row["name"] . " | " . $row["description"] . " | " . $row["type"] . " <form action='download.php' method='POST' target='_blank'><input type='hidden' name='file' value='" . $row["id"] . "'><input type='submit' value='Herunterladen'></form></td></tr>";
}
echo "</table>";
} else {
echo "Keine Nachrichten";
}
?>
</ul>
</body>
</html>