-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrand.php
More file actions
44 lines (36 loc) · 844 Bytes
/
rand.php
File metadata and controls
44 lines (36 loc) · 844 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
44
<?php
echo '
<title>Random PPT Link Generator</title>
<meta charset="UTF-8" />
';
echo '
<script>
function open_in_new_tab_and_reload(url)
{
//Open in new tab
window.open(url , \'_blank\');
//focus to thet window
window.focus();
//reload current page
location.reload();
}
</script>
';
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-';
$string = '';
$random_string_length = 4;
for ($i = 0; $i < $random_string_length; $i++) {
$string .= $characters[rand(0, strlen($characters) - 1)];
}
echo '
<center>
<table width="800" height="600">
<tr><td align="center" valign="center">
';
echo '
<a href="#" onclick="open_in_new_tab_and_reload(\''.'http://ppt.cc/'.$string.'\')" >Press here~</a></br>
</td></tr>
</table>
</center>
';
?>