This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
50 lines (42 loc) · 1.69 KB
/
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
<?php require_once './inc/header.php'; require_once './inc/menu.php';?>
<script type='text/javascript'>
var ourscore = Math.floor(<?php echo $_SESSION['score']; ?>);
updateScore();
</script>
<div id="points"></div>
<div id="container" class="row-fluid">
<div id='debug_div' class="span6"></div>
<div id='informations' class="span6">
<div id="score_div"></div>
<div id="fb-root"></div>
<form id="guess_form" method='POST' action='right.php'>
<label for="guess_name">Name: </label>
<input id="guess_name" name="guess_name" />
<input type="hidden" id='photo_url' name='photo_url' value=''>
<input type="hidden" id='friend_name' name='friend_name' value=''>
<input type="hidden" id='new_score' name='new_score' value=''>
<input type="hidden" id='actual_user' name='actual_user' value=''>
<button id="guess_button" class="btn" onclick='guessWho()'>Guess Who?!</button>
</form>
</div>
</div>
<script>
$("#container").hide();
</script>
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
<script type='text/javascript'>
function guessWho() {
if (chosenFriendName == document.getElementById('guess_name').value) {
ourscore = ourscore + points;
}
document.getElementById('new_score').value = Math.floor(ourscore);
document.getElementById('photo_url').value = chosenFriendPhoto;
document.getElementById('friend_name').value = chosenFriendName;
document.getElementById('actual_user').value = actualUserName;
$("#guess_form").submit(function() {
return true;
});
updateSessionScore();
}
</script>
<?php require_once './inc/footer.php'; ?>