aboutsummaryrefslogtreecommitdiff
path: root/images/index.php
blob: 84c0b5ce1578528287b157e9b8e0317056c7b26d (plain)
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
<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="/style.css" />
    <title>Bloggings</title>
  </head>
  <body>
    <header>
      <div class="center">
      <h1>Bloggings</h1>
      </div>
      <a href="/index.php">Back</a>
      <hr />
    </header>
<h2><?php echo dirname($_SERVER['SCRIPT_NAME']);?></h2>
  <?php
  $images = glob("./*.{jpg,jpeg,gif,png,bmp,webp,webP,svg}", GLOB_BRACE);
  sort ($images);
  foreach ($images as $i) {
    $img = basename($i);
    $caption = ucfirst(substr($img, 0, strrpos($img, ".")));
    printf("<figure><img src='./%s'/><figcaption>%s</figcaption></figure>", $img, $caption);
  }
  ?>
</body>
</html>