-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
43 lines (29 loc) · 705 Bytes
/
Copy pathindex.php
File metadata and controls
43 lines (29 loc) · 705 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
33
34
35
36
37
38
39
40
41
42
43
<!doctype html>
<html>
<head>
<title>:DD</title>
</head>
<body>
<?php
$folder = 'img';
$files = scandir($folder);
// remove hidden files
$files = array_diff($files, array('.','..'));
// re-index array
$files = array_values($files);
$range = count($files);
$index = rand(0,$range-1);
$imageName = $files[$index];
/*
print_r($files);
echo "$range <br />";
echo "$index <br />";
echo $imageName;
*/
?>
<h2> <a href=".">Get another meme</a> </h2>
<img height="700" src='<?php echo "img/$imageName"; ?>' />
<br />
<a href=' <?php echo "img/$imageName" ?> '>Permalink</a>
</body>
</html>