-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
53 lines (41 loc) · 1.25 KB
/
index.php
File metadata and controls
53 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
require_once('sql-connector.php');
// Fetch a random video from the database
if (!$res = $mysqli->query("SELECT * FROM videos ORDER BY RAND() LIMIT 1")) {
echo "Failed to query database: (" . $mysqli->errno . ") " . $mysqli->error;
}
$video = $res->fetch_assoc();
$mysqli->close();
if (!$video) {
echo "No videos found.";
}
?>
<html lang=en>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
$files = scandir('files');
$num_files = count($files);
?>
<title><?php echo $num_files ?> webms</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/main.css">
<script src="js/main.js"></script>
</head>
<body bgcolor="#000000" text="white" onLoad="JSFX_StartEffects()" onClick="location.reload()">
<div class="center"><a href='#'>
<!-- Text redirects to link -->
<span id="h1">
<h1>Text here-</h1> <!-- Text shown in the right corner -->
</span>
</a></div>
<video
id="video"
src="<?php echo $webm_path . $video->file; ?>" autoplay loop>
<p>Your browser doesn't support the video tag.</p>
</video>
<body bgcolor="#000000" text="white" onLoad="JSFX_StartEffects()">
<span id="h1"></a></span>
</body>
</html>