D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skyconb
/
newsyacine
/
Filename :
nouveau 1.txt
back
Copy
<?php // =============================================== // PHP: جلب بيانات الفيديو // =============================================== // تأكد من وجود هذا الملف في نفس المجلد include 'db_connect.php'; // التأكد من وجود معرّف الفيديو (id) في الرابط if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { die("خطأ: لم يتم تحديد معرّف الفيديو."); } $video_id = $_GET['id']; // استعلام SQL لجلب بيانات الفيديو المحدد $sql = "SELECT title, description, m3u8_link FROM videos WHERE id = ?"; // استخدام Prepared Statements لتجنب هجمات SQL Injection $stmt = $conn->prepare($sql); $stmt->bind_param("i", $video_id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows === 0) { die("لم يتم العثور على الفيديو المطلوب."); } $video = $result->fetch_assoc(); $m3u8_link = $video['m3u8_link']; // رابط m3u8 $video_title = htmlspecialchars($video['title']); $video_description = htmlspecialchars($video['description']); // تحديث عداد المشاهدات (اختياري) // نستخدم COALESCE لضمان أن الحقل 'views' يبدأ من صفر إذا كان NULL $conn->query("UPDATE videos SET views = COALESCE(views, 0) + 1 WHERE id = $video_id"); $conn->close(); ?> <!DOCTYPE html> <html lang="ar" dir="rtl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo $video_title; ?></title> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> <style> /* CSS للتصميم الأنيق */ body { font-family: Tahoma, sans-serif; margin: 0; background-color: #f0f2f5; } .header { background-color: #2c3e50; color: white; padding: 15px 20px; text-align: right; display: flex; justify-content: space-between; align-items: center; } .header h2 { margin: 0; font-size: 1.5em; } .header a { color: #3498db; text-decoration: none; font-weight: bold; padding: 5px 10px; border-radius: 4px; transition: background-color 0.3s; } .header a:hover { background-color: #34495e; color: #f4f4f4; } .container { max-width: 900px; margin: 30px auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: right; } h1 { color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 10px; } #video { width: 100%; max-height: 500px; background-color: black; border-radius: 4px; margin-bottom: 20px; } p { color: #555; line-height: 1.6; } </style> </head> <body> <div class="header"> <h2>مشاهدة الفيديو</h2> <a href="index.php">العودة إلى القائمة الرئيسية</a> </div> <div class="container"> <video id="video" controls></video> <h1><?php echo $video_title; ?></h1> <p><?php echo $video_description; ?></p> </div> <script> var video = document.getElementById('video'); // تأكد من أن الرابط تم