D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
delete_video.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html> <head> <title>Delete Video</title> <!-- Add Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> </head> <body> <div class="container"> <h1>Delete Video</h1> <form action="deleted_video.php" method="post"> <?php // Create a connection to the database $conn = new mysqli($servername, $username, $password, $dbname); // Check the connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Fetch videos from the database $sql = "SELECT * FROM videos ORDER BY id DESC"; $result = $conn->query($sql); if ($result->num_rows > 0) { $counter = 0; // Initialize a counter while ($row = $result->fetch_assoc()) { if ($counter % 4 == 0) { echo '<div class="row">'; } echo '<div class="col-md-3">'; echo '<div class="card mb-3">'; echo '<div class="card-body">'; echo '<h5 class="card-title">' . $row['vedio_name'] . '</h5>'; echo '<p class="card-text">' . $row['description'] . '</p>'; echo '<label for="video_' . $row['id'] . '">Delete:</label>'; echo '<input type="checkbox" name="videosToDelete[]" id="video_' . $row['id'] . '" value="' . $row['id'] . '">'; echo '</div>'; echo '</div>'; echo '</div>'; if ($counter % 4 == 3) { echo '</div>'; } $counter++; } if ($counter % 4 != 0) { echo '</div>'; // Close the row if it's not already closed } } else { echo "No videos found."; } // Close the database connection $conn->close(); ?> <button type="submit" class="btn btn-danger">Delete Selected Videos</button> </form> </div> <!-- Add Bootstrap JS and jQuery --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </body> </html>