D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
category.php
back
Copy
<?php include "../config.php"; // Retrieve the selected category from the query string if (isset($_GET['category'])) { $selected_category = urldecode($_GET['category']); // Query to select audio records for the selected category $query = "SELECT * FROM audio_files WHERE category = '$selected_category'"; $result = $conn->query($query); // Store audio records in an array $audio_records = []; if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $audio_records[] = $row; } } } else { echo "Invalid category selection."; $conn->close(); exit(); } // Close the database connection $conn->close(); ?> <!DOCTYPE html> <html> <head> <title><?php echo $selected_category; ?></title> <meta charset="UTF-8"> <!-- responsive meta --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- For IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Module css --> </head> <body> <h1><?php echo $selected_category; ?></h1> <!-- List audio records for the selected category with links to details pages --> <ul> <?php foreach ($audio_records as $record) { $audio_id = $record["id"]; $english_title = $record["english_title"]; ?> <li> <a href="details.php?id=<?php echo $audio_id; ?>"> <?php echo $english_title; ?> </a> </li> <?php } ?> </ul> </body> </html>