- <?php
- $img_array = glob("img/*.{gif,jpg,png}", GLOB_BRACE);
- $img = array_rand($img_array);
- $dz = $img_array[$img];
- list($width, $height) = getimagesize($dz);
- header("Content-Type: image/jpeg");
- readfile($dz);
- ?>
复制代码
pic.php
- <!DOCTYPE html>
- <html>
- <head>
- <title>导航→Navigation</title>
- <meta http-equiv="Content-Language" content="zh-cn" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <base target="_blank">
- <style>
- body {
- margin:25px;
- }
- .ccc {
- width: 100%;
- background-color: #ccc;
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
- margin-bottom: 25px;
- border-radius: 10px;
- }
- .container {
- border-radius: 10px;
- text-align: center;
- padding: 10px 20px;
- margin: 0px;
- }
- .footer{
- text-align: center;
- margin: 0px;
- padding: 50px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="ccc">
- <img src="pic.php">
- </div>
- <div>
- <button onclick="refreshPage()">刷新页面</button>
- <script>
- function refreshPage() {
- location.reload();
- }
- </script>
- </div>
- </div>
- <div class="footer">
- Copyright © 2005-<script type="text/javascript">document.write((new Date()).getFullYear());</script> All rights reserved.</a>
- </div>
- </body>
- </html>
复制代码
index.php
demo:web.xd94.com/index.php |