D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
delete_audio.php
back
Copy
<?php include "../config.php"; ?> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { // Handle form submission for deleting audio file $id = $_POST["id"]; // Establish a database connection $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Delete the audio file from the database $query = "DELETE FROM audio_files WHERE id = $id"; if ($conn->query($query) === TRUE) { echo "Record deleted successfully."; } else { echo "Error deleting record: " . $conn->error; } $conn->close(); } else { // Retrieve the audio file details based on the provided ID if (isset($_GET["id"])) { $id = $_GET["id"]; } } ?> <!DOCTYPE html> <html> <head> <title>Delete Audio File</title> </head> <body> <h1>Delete Audio File</h1> <p>Are you sure you want to delete this audio file?</p> <form method="post" action="delete_audio.php"> <input type="hidden" name="id" value="<?php echo $id; ?>"> <input type="submit" value="Delete"> </form> </body> </html>