forked from codepo8/calendar-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom.php
52 lines (51 loc) · 1018 Bytes
/
random.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Random-ish distribution</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
* {
margin: 0;
padding: 0;
font-size: 15px;
font-family: helvetica,arial,sans-serif;
}
footer, section, header {
display: block;
}
section {
width: 700px;
height: 800px;
position: relative;
background: #b4d455;
}
li {
position: absolute;
width: 40px;
height: 40px;
background: #c0ffee;
list-style: none;
}
</style>
</head>
<body>
<section>
<?php
echo '<ol>';
$width = 700;
$height = 800;
for ($i=0;$i<24;$i++) {
$x = rand(10,$width-20);
$y = rand(10,$width-20);
echo '<li style="left:'.$x.'px;top:'.$y.'px">'.
'<a href="index.php?day='.($i+1).'">'.($i+1).'</a>'.
'</li>';
}
echo '</ol>';
?>
</section>
<script>
</script>
</body>
</html>