D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
deleted_video.php
back
Copy
<?php include "../config.php"; ?> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST['videosToDelete']) && is_array($_POST['videosToDelete'])) { $videosToDelete = $_POST['videosToDelete']; $videoIds = implode(",", $videosToDelete); // Convert array to a comma-separated string // Delete selected videos from the database $sql = "DELETE FROM videos WHERE id IN ($videoIds)"; if ($conn->query($sql) === TRUE) { echo count($videosToDelete) . " videos deleted successfully!"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } } // Close the database connection $conn->close(); } else { // If the form was not submitted, redirect to the form page header("Location: delete_videos_form.php"); exit(); } ?>