D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
view_video.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>View Video</title> <link href="table.css" rel="stylesheet"> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet"> </head> <body> <h1>Video Details</h1> <?php if (isset($_GET['id'])) { // Get the video ID from the URL $video_id = $_GET['id']; // Query to retrieve the video details $sql = "SELECT * FROM videos WHERE id = $video_id"; $result = $conn->query($sql); if ($result->num_rows == 1) { $row = $result->fetch_assoc(); echo "<h2>" . $row['vedio_name'] . "</h2>"; echo "<p>Category: " . $row['vedio_category'] . "</p>"; echo "<p>Description: " . $row['description'] . "</p>"; echo "<p>Video Date: " . $row['vedio_date'] . "</p>"; function getYouTubeVideoID($url) { $videoID = ''; $pattern = '/[\\?\\&]v=([^\\?\\&]+)/'; preg_match($pattern, $url, $matches); if (isset($matches[1])) { $videoID = $matches[1]; } return $videoID; } // Embed the YouTube video using an iframe echo '<div class="video-container">'; echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/' . getYouTubeVideoID($row['vedio_link']) . '" frameborder="0" allowfullscreen></iframe>'; echo '</div>'; echo "<p>Video Image: <img src='video_img/" . $row['vedio_img'] . "' alt='Video Image' width='200'></p>"; } else { echo "Video not found."; } // Close the database connection $conn->close(); } else { echo "Invalid video ID."; } ?> </body> </html>