forked from cmtcmt111/test-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (31 loc) · 714 Bytes
/
index.php
File metadata and controls
32 lines (31 loc) · 714 Bytes
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
<?php
$handler = opendir('data');
while (($filename = readdir($handler)) !== false) {
if ($filename != "." && $filename != "..") {
$list[] = explode(".txt",$filename)[0];
}
}
$index=array_rand($list);
$target=$list[$index];
$content=file_get_contents(dirname(__FILE__)."/data/$target.txt");
?>
<style>
div {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
}
p {
font-size: 5rem;
margin: 0;
text-align: center;
}
</style>
<div>
<p><?php echo $content.'<br>——'.$target; ?></p>
</div>