-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·51 lines (37 loc) · 985 Bytes
/
index.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>
<head>
<title>3-PRLT</title>
<script>
//onbeforeunload in body
function areYouSure() {
return "Write something clever here...";
}
areYouSure();
</script>
</head>
<body id='unload' onbeforeunload="return areYouSure()">
<script>
function getParamFromURL(name)
{
name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var regexS = "[\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
// Take the user to a random URL, selected from the pool below
var links = [];
var usernameFromParamString = getParamFromURL( 'workerId' );
links[0]="code/card_task_01.php"//+"?workerId="+usernameFromParamString; // Expt 1: Paranoia Reversals 11-30-2017
function randomizeURL(linkArray)
{
window.location=linkArray[Math.floor(Math.random()*linkArray.length)];
}
randomizeURL(links);
</script>
</body>
</html>