Problemen met script...
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
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
<?php while($row = mysql_fetch_array($result)){
if($row['online'] == "Wi-Fi"){
$1 = "CHECKED";
}
if($row['online'] == "DS to DS"){
$2 = "CHECKED";
}
if($row['online'] == "Wi-Fi en DS to DS"){
$3 = "CHECKED";
}
if($row['online'] == "Nee"){
$4 = "CHECKED";
}
echo('
<form method="post" action="'. $_SERVER['PHP_SELF'] .'" >
<table width="380">
<tr><td><b>Titel</b></td><td>
<input type="text" size="60" value="'.$row['titel'].'" name="titel"></td></tr>
<tr><td><b>Tekst</b></td><td>
<textarea cols="80" rows="15" name="tekst">'.$row['tekst'].'</textarea></td></tr>
<tr><td colspan="2" align="center"><p><u><b>Cijfers</b></u></td></tr>
<tr><td><b>Graphics</b></td><td>
<input type="text" size="3" name="score1" value="'.$row['score1'].'"></td></tr>
<tr><td><b>Touchscreen</b></td><td>
<input type="text" size="3" name="score2" value="'.$row['score2'].'"></td></tr>
<tr><td><b>Besturing</b></td><td>
<input type="text" size="3" name="score3" value="'.$row['score3'].'"></td></tr>
<tr><td><b>Gameplay</b></td><td>
<input type="text" size="3" name="score4" value="'.$row['score4'].'"></td></tr>
<tr><td><b>Levensduur</b></td><td>
<input type="text" size="3" name="score5" value="'.$row['score5'].'"></td></tr>
<tr><td><b>Geluid</b></td><td>
<input type="text" size="3" name="score6" value="'.$row['score6'].'"></td></tr>
<tr><td><b>Geheel</b></td><td>
<input type="text" size="3" name="score7" value="'.$row['score7'].'"></td></tr>
<tr><td colspan="2" align="center"><p><u><b>Gegevens</b></u></td></tr>
<tr><td><b>Uitgever</b></td><td>
<input type="text" size="40" name="uitgever" value="'.$row['uitgever'].'"></td></tr>
<tr><td><b>Ontwikkelaar</b></td><td>
<input type="text" size="40" name="ontwikkelaar" value="'.$row['ontwikkelaar'].'"></td></tr>
<tr><td><b>Genre</b></td><td>
<input type="text" size="40" name="genre" value="'.$row['genre'].'"></td></tr>
<tr><td><b>Releasedatum</b></td><td>
<input type="text" size="40" name="release" value="'.$row['release'].'"> <i>dd/mm/jjjj</i></td></tr>
<tr><td><b>Online</b></td><td>
<input type="radio" name="online" value="Wi-Fi" '.$1.'>Wi-Fi, <input type="radio" name="online" value="DS to DS" '.$2.'>DS to DS, <input type="radio" name="online" value="Wi-Fi en DS to DS" '.$3.'>Wi-Fi en DS to DS, <input type="radio" name="online" value="Nee" '.$4.'>Nee</td></tr>
</table>
<p>
<input type="submit" name="submit" value="Post">
</form>');
}?>
if($row['online'] == "Wi-Fi"){
$1 = "CHECKED";
}
if($row['online'] == "DS to DS"){
$2 = "CHECKED";
}
if($row['online'] == "Wi-Fi en DS to DS"){
$3 = "CHECKED";
}
if($row['online'] == "Nee"){
$4 = "CHECKED";
}
echo('
<form method="post" action="'. $_SERVER['PHP_SELF'] .'" >
<table width="380">
<tr><td><b>Titel</b></td><td>
<input type="text" size="60" value="'.$row['titel'].'" name="titel"></td></tr>
<tr><td><b>Tekst</b></td><td>
<textarea cols="80" rows="15" name="tekst">'.$row['tekst'].'</textarea></td></tr>
<tr><td colspan="2" align="center"><p><u><b>Cijfers</b></u></td></tr>
<tr><td><b>Graphics</b></td><td>
<input type="text" size="3" name="score1" value="'.$row['score1'].'"></td></tr>
<tr><td><b>Touchscreen</b></td><td>
<input type="text" size="3" name="score2" value="'.$row['score2'].'"></td></tr>
<tr><td><b>Besturing</b></td><td>
<input type="text" size="3" name="score3" value="'.$row['score3'].'"></td></tr>
<tr><td><b>Gameplay</b></td><td>
<input type="text" size="3" name="score4" value="'.$row['score4'].'"></td></tr>
<tr><td><b>Levensduur</b></td><td>
<input type="text" size="3" name="score5" value="'.$row['score5'].'"></td></tr>
<tr><td><b>Geluid</b></td><td>
<input type="text" size="3" name="score6" value="'.$row['score6'].'"></td></tr>
<tr><td><b>Geheel</b></td><td>
<input type="text" size="3" name="score7" value="'.$row['score7'].'"></td></tr>
<tr><td colspan="2" align="center"><p><u><b>Gegevens</b></u></td></tr>
<tr><td><b>Uitgever</b></td><td>
<input type="text" size="40" name="uitgever" value="'.$row['uitgever'].'"></td></tr>
<tr><td><b>Ontwikkelaar</b></td><td>
<input type="text" size="40" name="ontwikkelaar" value="'.$row['ontwikkelaar'].'"></td></tr>
<tr><td><b>Genre</b></td><td>
<input type="text" size="40" name="genre" value="'.$row['genre'].'"></td></tr>
<tr><td><b>Releasedatum</b></td><td>
<input type="text" size="40" name="release" value="'.$row['release'].'"> <i>dd/mm/jjjj</i></td></tr>
<tr><td><b>Online</b></td><td>
<input type="radio" name="online" value="Wi-Fi" '.$1.'>Wi-Fi, <input type="radio" name="online" value="DS to DS" '.$2.'>DS to DS, <input type="radio" name="online" value="Wi-Fi en DS to DS" '.$3.'>Wi-Fi en DS to DS, <input type="radio" name="online" value="Nee" '.$4.'>Nee</td></tr>
</table>
<p>
<input type="submit" name="submit" value="Post">
</form>');
}?>
(
de fout is dat je niet $1 $2 $3 ... kan doen, mag niet numeriek zijn.
)
Je mag en variable niet met een getal laten beginnen. Gebruik eerst een letter en dan pas een getal (of kies gewoon duidelijke namen voor je variablen...)
Danku voor het helpen