in nieuw venster niets kunnen scrollen?!
Code (javascript)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<script type="text/javascript">
<!--
function start_game(id) {
var locatie = 'game.php?id=' + id;
var venster = window.open(locatie, '_self');
}
// -->
</script>
<!--
function start_game(id) {
var locatie = 'game.php?id=' + id;
var venster = window.open(locatie, '_self');
}
// -->
</script>
Deze code gebruik in om een game te laten openen (de rest wordt door PHP geregeld).
Alleen in het nieuwe venster kan ik niet meer scrollen!
Hoe kan ik dit oplossen?
(Ik ben nooit echt goed in Javascript geweest).
De php code in game.php is:
Code (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
// controlle
if (empty($_GET)) {
@ob_end_clean();
if (isset($_SERVER['SERVER_PROTOCOL']) && ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')) {
header('HTTP/1.0 404 Not found',TRUE,404);
} else {
header('HTTP/1.1 404 Not found',TRUE,404);
}
exit;
}
else {
$code = array();
$code['001'] = 'games/Asteroids/index.html';
$code['002'] = 'Dobbelen';
include $code[(string)$_GET['id'] ];
flush();
//footer-info
unset($code);
//model
$code = array();
$code['001'] = 'asteroids';
$code['002'] = 'dobbelen';
//controller
$db_link = mysqli_connect("localhost","pkfw155654_games","oyKYARE7y03QhBQnScdq","pkfw155654_games") or die("Er is iets fout gegaan bij het ophalen van de informatie.");
$sql = "
SELECT * FROM `highscores_".$code[$_GET['id']]."` ORDER BY `score` DESC LIMIT 10
";
$result=mysqli_query($db_link,$sql) or die("Er is iets fout gegaan bij het ophalen van de informatie.");
unset($sql);
$sql = "
SELECT ratio FROM `game_ratios` WHERE `naam` = '".$code[$_GET['id']]."'
";
$ratio=mysqli_query($db_link,$sql) or die("Er is iets fout gegaan bij het ophalen van de informatie.");
mysqli_close($db_link);
//zoek mysqli_free_result op
//vieuw
echo '
<style type="text/css">
<!--
.plek1, .plek2, .plek3 {
background-color:gold;
}
.plek4, .plek5, .plek6 {
background-color:silver;
}
.plek7, .plek8, .plek9, .plek10 {
background-color:brown;
}
-->
</style>
';
echo '<div style="background-color:white; color:black; border: 2px solid #2f4f4f; font-family:Arial;">';
echo '<h1>Highscores</h1>';
$i = 1;
echo '<table border="1" style="margin:5px;" width="25%">';
echo '<tr>
<th> </th><th>Naam</th><th>Score</th>
</tr>';
$rijen = 0;
while($rows=mysqli_fetch_assoc($result)){
echo '<tr class="plek',$i,'">';
echo '<td>',$i,'.</td><td>',$rows['name'],':</td><td>',$rows['score'],"</td>";
echo '</tr>';
$rijen++;
$i++;
}
if ($rijen < 11) { //er zijn nog geen 10 scores
$required = 10 - $rijen;
for ($e = 0; $e < $required; $e++) { //bijvullen
echo '<tr class="plek',$i,'">';
echo '<td>',$i,'.</td><td>???</td><td>???</td>';
echo '</tr>';
$i++;
}
}
echo '</table>';
echo '</div></div>';
}
?>
// controlle
if (empty($_GET)) {
@ob_end_clean();
if (isset($_SERVER['SERVER_PROTOCOL']) && ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')) {
header('HTTP/1.0 404 Not found',TRUE,404);
} else {
header('HTTP/1.1 404 Not found',TRUE,404);
}
exit;
}
else {
$code = array();
$code['001'] = 'games/Asteroids/index.html';
$code['002'] = 'Dobbelen';
include $code[(string)$_GET['id'] ];
flush();
//footer-info
unset($code);
//model
$code = array();
$code['001'] = 'asteroids';
$code['002'] = 'dobbelen';
//controller
$db_link = mysqli_connect("localhost","pkfw155654_games","oyKYARE7y03QhBQnScdq","pkfw155654_games") or die("Er is iets fout gegaan bij het ophalen van de informatie.");
$sql = "
SELECT * FROM `highscores_".$code[$_GET['id']]."` ORDER BY `score` DESC LIMIT 10
";
$result=mysqli_query($db_link,$sql) or die("Er is iets fout gegaan bij het ophalen van de informatie.");
unset($sql);
$sql = "
SELECT ratio FROM `game_ratios` WHERE `naam` = '".$code[$_GET['id']]."'
";
$ratio=mysqli_query($db_link,$sql) or die("Er is iets fout gegaan bij het ophalen van de informatie.");
mysqli_close($db_link);
//zoek mysqli_free_result op
//vieuw
echo '
<style type="text/css">
<!--
.plek1, .plek2, .plek3 {
background-color:gold;
}
.plek4, .plek5, .plek6 {
background-color:silver;
}
.plek7, .plek8, .plek9, .plek10 {
background-color:brown;
}
-->
</style>
';
echo '<div style="background-color:white; color:black; border: 2px solid #2f4f4f; font-family:Arial;">';
echo '<h1>Highscores</h1>';
$i = 1;
echo '<table border="1" style="margin:5px;" width="25%">';
echo '<tr>
<th> </th><th>Naam</th><th>Score</th>
</tr>';
$rijen = 0;
while($rows=mysqli_fetch_assoc($result)){
echo '<tr class="plek',$i,'">';
echo '<td>',$i,'.</td><td>',$rows['name'],':</td><td>',$rows['score'],"</td>";
echo '</tr>';
$rijen++;
$i++;
}
if ($rijen < 11) { //er zijn nog geen 10 scores
$required = 10 - $rijen;
for ($e = 0; $e < $required; $e++) { //bijvullen
echo '<tr class="plek',$i,'">';
echo '<td>',$i,'.</td><td>???</td><td>???</td>';
echo '</tr>';
$i++;
}
}
echo '</table>';
echo '</div></div>';
}
?>
Gewijzigd op 01/06/2013 11:43:10 door Haubebla haubebla
Er zijn nog geen reacties op dit bericht.