D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
categories.php
back
Copy
<?php include "../config.php"; // Retrieve all unique categories $query = "SELECT DISTINCT category FROM audio_files"; $result = $conn->query($query); // Store categories in an array $categories = []; if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $categories[] = $row["category"]; } } // Close the database connection $conn->close(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Categories</title> <link rel="stylesheet" href="css.css"> </head> <body> <header> <div class="logo"><img src="logo.png"></div> </header> <div class="mainbody"> <div class="bodyarea"> <h1>Categories</h1> <!-- List all unique categories and link to audio records by category --> <ul> <?php foreach ($categories as $category) { ?> <li> <a href="category.php?category=<?php echo urlencode($category); ?>"><?php echo $category; ?></a> </li> <?php } ?> </ul> </div> </div> </div> <footer> <a href="https://webograph.pk/">Site BY Webograph.pk</a> </footer> </body> </html>