elke keer ander stukje tekst
Ik ben bezig met een voetbalmanager website. Ik heb gemaakt dat je een club kan kiezen, en dat er automatish in je profiel komt te staan: Club: (bijvoorbeeld) Graafschap.
Maar nu wil ik, dat als je bijvoorbeeld graafschap kiest, dat er dan ook in een stukje van je profiel komt te staan: HOIHOI! WIJ ZIJN DE GRAAFSCHAP, en als je bijvoorbeeld Ajax kiest, er komt te staan: HOIHOI! WIJ ZIJN AJAX! enzovoort enzovoort.
ps: de tekst slaat natuurlijk nergens op, maar die weizig ik later in de spelers van het team.
Vele profs zeggen dat dit 7 minutjes werk is, maar dat ze ff ergens anders mee bezig zijn. Kunnen jullie dit eventueel scripten (want dit is redelijk makkelijk zeggen ze, in iedergeval als je prof bent).
Als je het script van "profiel" nodig hebt, of van "kies een club", vermeld dat maar!
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?php
include('include/header.php');
if($inlog == 'true'){
echo '<table width="100%" border="0" cellpadding="2" cellspacing="0" color="000000">';
echo '<tr>';
$sql = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$res = mysql_query($sql) OR die (mysql_error());
while($rij = mysql_fetch_assoc($res)){
if($rij['ava'] != ""){
echo '<td valign="top">';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Avater</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif"></td>';
echo '<td background="images/menu_05.gif"><img src="'.$rij['ava'].'"></td>';
echo '<td background="images/menu_06.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
echo '</td>';
}
}
echo '<td valign="top" width="100%">';
echo '<table cellpadding="0" width="100%" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Gegevens</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$d = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$h = mysql_query($d) OR die (mysql_error());
while($rij = mysql_fetch_array($h)){
echo '<table cellpadding="2" cellspacing="0">';
echo '<tr>';
echo '<td>';
echo '<b>Naam:';
echo '</td>';
echo '<td>';
echo $rij['naam'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Geslacht:';
echo '</td>';
echo '<td>';
echo ucfirst($rij['geslacht']);
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Euros:';
echo '</td>';
echo '<td>';
$dds = 'SELECT * FROM muntjes WHERE from_ID="'.$rij['ID'].'"';
$md = mysql_query($dds) OR die (mysql_error());
while($m = mysql_fetch_array($md)){
echo $m['aantal'];
}
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Rang:';
echo '</td>';
echo '<td>';
echo ucfirst($rij['rang']);
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Club:';
echo '</td>';
echo '<td>';
echo $rij['Club'];
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
}
echo '</td>';
echo '</tr>';
echo '</table><p>';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif" width="95%"><div id="login"><b>Team:</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$sql = 'SELECT * FROM badge_verdien WHERE to_ID="'.$_COOKIE['ID'].'"';
$resultaat = mysql_query($sql) OR die (mysql_error());
if($rang == 'admin'){
echo '<img src="images/badges/admin.gif"> ';
} else if($rang == 'VIP'){
echo '<img src="images/badges/vip.gif"> ';
} else if($rang == 'mod'){
echo '<img src="images/badges/moderator.gif"> ';
} else if($rang == 'nieuws'){
echo '<img src="images/badges/manager.gif"> ';
}
echo '<img src="images/badges/member.gif"> ';
while($rij = mysql_fetch_array($resultaat)){
$da = 'SELECT * FROM badge WHERE ID="'.$rij['ID'].'"';
$ad = mysql_query($da) OR die (mysql_error());
$es = mysql_fetch_assoc($ad);
echo '<img src="'.$es['url'].'" border="0"> ';
}
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Aankopen:</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$fas = 'SELECT * FROM handtas WHERE Handtas_geb_ID="'.$_COOKIE['ID'].'" AND Handtas_use!="ja"';
$ms = mysql_query($fas) OR die (mysql_error());
$i = 1;
while($r = mysql_fetch_array($ms)){
$sel = 'SELECT * FROM winkel WHERE Artikel_ID="'.$r['Handtas_art_ID'].'"';
$mys = mysql_query($sel) OR die (mysql_error());
$ass = mysql_fetch_assoc($mys);
if($ass['Artikel_spec'] == 'ja'){
echo '<a href="show_artikel_use.php?geb_ID='.$_COOKIE['ID'].'&ID='.$ass['Artikel_ID'].'&handtas_ID='.$r['Handtas_ID'].'"><img src="'.$ass['Artikel_img_URL'].'" alt="'.$ass['Artikel_naam'].'"></a> ';
} else {
echo '<img src="'.$ass['Artikel_img_URL'].'" alt="'.$ass['Artikel_naam'].'"> ';
}
if($i == 5){
echo '<br>';
$i = 0;
} else {
$i = $i + 1;
}
}
echo '<br><b>Dit zijn jou aankopen!</b>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
$fda = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$fsa = mysql_query($fda) OR die (mysql_error());
while($des = mysql_fetch_array($fsa)){
if($des['handtekening'] == ""){
echo '';
} else {
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Basisspelers voor volgende wedstrijd</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
echo handtek($des['handtekening']);
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
}
}
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Instellingen</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
echo '<table>';
echo '<tr>';
echo '<td>';
echo knop('Wachtwoord veranderen', 'edit_profiel.php?action=editpw');
echo '</td>';
echo '<td>';
echo knop('Avater veranderen', 'edit_profiel.php?action=editava');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<table>';
echo '<tr>';
echo '<td>';
echo knop('Geslacht veranderen', 'edit_profiel.php?action=editender');
echo '</td>';
echo '<td>';
echo knop('Basisspelers veranderen', 'edit_profiel.php?action=edithand');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
} else {
echo 'Je moet ingelogd zijn om op deze pagina te komen!';
}
include('include/footer.php');
?>
include('include/header.php');
if($inlog == 'true'){
echo '<table width="100%" border="0" cellpadding="2" cellspacing="0" color="000000">';
echo '<tr>';
$sql = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$res = mysql_query($sql) OR die (mysql_error());
while($rij = mysql_fetch_assoc($res)){
if($rij['ava'] != ""){
echo '<td valign="top">';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Avater</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif"></td>';
echo '<td background="images/menu_05.gif"><img src="'.$rij['ava'].'"></td>';
echo '<td background="images/menu_06.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
echo '</td>';
}
}
echo '<td valign="top" width="100%">';
echo '<table cellpadding="0" width="100%" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Gegevens</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$d = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$h = mysql_query($d) OR die (mysql_error());
while($rij = mysql_fetch_array($h)){
echo '<table cellpadding="2" cellspacing="0">';
echo '<tr>';
echo '<td>';
echo '<b>Naam:';
echo '</td>';
echo '<td>';
echo $rij['naam'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Geslacht:';
echo '</td>';
echo '<td>';
echo ucfirst($rij['geslacht']);
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Euros:';
echo '</td>';
echo '<td>';
$dds = 'SELECT * FROM muntjes WHERE from_ID="'.$rij['ID'].'"';
$md = mysql_query($dds) OR die (mysql_error());
while($m = mysql_fetch_array($md)){
echo $m['aantal'];
}
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Rang:';
echo '</td>';
echo '<td>';
echo ucfirst($rij['rang']);
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<b>Club:';
echo '</td>';
echo '<td>';
echo $rij['Club'];
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
}
echo '</td>';
echo '</tr>';
echo '</table><p>';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif" width="95%"><div id="login"><b>Team:</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$sql = 'SELECT * FROM badge_verdien WHERE to_ID="'.$_COOKIE['ID'].'"';
$resultaat = mysql_query($sql) OR die (mysql_error());
if($rang == 'admin'){
echo '<img src="images/badges/admin.gif"> ';
} else if($rang == 'VIP'){
echo '<img src="images/badges/vip.gif"> ';
} else if($rang == 'mod'){
echo '<img src="images/badges/moderator.gif"> ';
} else if($rang == 'nieuws'){
echo '<img src="images/badges/manager.gif"> ';
}
echo '<img src="images/badges/member.gif"> ';
while($rij = mysql_fetch_array($resultaat)){
$da = 'SELECT * FROM badge WHERE ID="'.$rij['ID'].'"';
$ad = mysql_query($da) OR die (mysql_error());
$es = mysql_fetch_assoc($ad);
echo '<img src="'.$es['url'].'" border="0"> ';
}
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Aankopen:</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
$fas = 'SELECT * FROM handtas WHERE Handtas_geb_ID="'.$_COOKIE['ID'].'" AND Handtas_use!="ja"';
$ms = mysql_query($fas) OR die (mysql_error());
$i = 1;
while($r = mysql_fetch_array($ms)){
$sel = 'SELECT * FROM winkel WHERE Artikel_ID="'.$r['Handtas_art_ID'].'"';
$mys = mysql_query($sel) OR die (mysql_error());
$ass = mysql_fetch_assoc($mys);
if($ass['Artikel_spec'] == 'ja'){
echo '<a href="show_artikel_use.php?geb_ID='.$_COOKIE['ID'].'&ID='.$ass['Artikel_ID'].'&handtas_ID='.$r['Handtas_ID'].'"><img src="'.$ass['Artikel_img_URL'].'" alt="'.$ass['Artikel_naam'].'"></a> ';
} else {
echo '<img src="'.$ass['Artikel_img_URL'].'" alt="'.$ass['Artikel_naam'].'"> ';
}
if($i == 5){
echo '<br>';
$i = 0;
} else {
$i = $i + 1;
}
}
echo '<br><b>Dit zijn jou aankopen!</b>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
$fda = 'SELECT * FROM inlog WHERE ID="'.$_COOKIE['ID'].'" AND hash="'.$_COOKIE['hash'].'"';
$fsa = mysql_query($fda) OR die (mysql_error());
while($des = mysql_fetch_array($fsa)){
if($des['handtekening'] == ""){
echo '';
} else {
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Basisspelers voor volgende wedstrijd</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
echo handtek($des['handtekening']);
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table><p>';
}
}
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '<tr>';
echo '<td><img src="images/menu_01.gif"></td>';
echo '<td background="images/menu_02.gif"><div id="login"><b>Instellingen</b></div></td>';
echo '<td><img src="images/menu_03.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/menu_04.gif" width="5"></td>';
echo '<td background="images/menu_05.gif" width="100%">';
echo '<table>';
echo '<tr>';
echo '<td>';
echo knop('Wachtwoord veranderen', 'edit_profiel.php?action=editpw');
echo '</td>';
echo '<td>';
echo knop('Avater veranderen', 'edit_profiel.php?action=editava');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<table>';
echo '<tr>';
echo '<td>';
echo knop('Geslacht veranderen', 'edit_profiel.php?action=editender');
echo '</td>';
echo '<td>';
echo knop('Basisspelers veranderen', 'edit_profiel.php?action=edithand');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td background="images/menu_06.gif" width="5"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/menu_07.gif"></td>';
echo '<td background="images/menu_08.gif"></td>';
echo '<td><img src="images/menu_09.gif"></td>';
echo '</tr>';
echo '</table>';
} else {
echo 'Je moet ingelogd zijn om op deze pagina te komen!';
}
include('include/footer.php');
?>
Script van "Kieseenclubjaaokee" ofzoiets:[/B]
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
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
<?php
include('include/header.php');
echo 'Kier hieronder u club:';
$iSelect = mysql_query("SELECT club,gekozen FROM clubs WHERE gekozen='0'")
or die ( mysql_error () );
echo '<form method="post" action="">
<select name=cluppie>';
while($iList = mysql_fetch_assoc($iSelect)){
echo '<option value="'. $iList['club'] .'"> '. $iList['club'] .' </option>';
}
echo '<input type=submit name=knop value="Kies!"></select></form>';
if($_POST['knop']){
echo ' Gefeliciteerd, je bent coach geworden van '.$_POST['cluppie'].'. <meta http-equiv="refresh" content="2;URL=index.php" />';
mysql_query("UPDATE clubs SET gekozen='1' WHERE club='".$_POST['cluppie']."'")
or die ( mysql_error () );
mysql_query("UPDATE inlog SET Club='".$_POST['cluppie']."'")
or die ( mysql_error () );
}
include('include/footer.php');
?>
include('include/header.php');
echo 'Kier hieronder u club:';
$iSelect = mysql_query("SELECT club,gekozen FROM clubs WHERE gekozen='0'")
or die ( mysql_error () );
echo '<form method="post" action="">
<select name=cluppie>';
while($iList = mysql_fetch_assoc($iSelect)){
echo '<option value="'. $iList['club'] .'"> '. $iList['club'] .' </option>';
}
echo '<input type=submit name=knop value="Kies!"></select></form>';
if($_POST['knop']){
echo ' Gefeliciteerd, je bent coach geworden van '.$_POST['cluppie'].'. <meta http-equiv="refresh" content="2;URL=index.php" />';
mysql_query("UPDATE clubs SET gekozen='1' WHERE club='".$_POST['cluppie']."'")
or die ( mysql_error () );
mysql_query("UPDATE inlog SET Club='".$_POST['cluppie']."'")
or die ( mysql_error () );
}
include('include/footer.php');
?>
Code (php)
Mag je ook schrijven als:
Code (php)
1
2
3
4
5
2
3
4
5
<?
echo '<td valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr>';
?>
echo '<td valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr>';
?>
Dat scheelt je al een hele lap code!
Uiteraard kun je ook helemaal buiten php springen of templates gaan gebruiken. Templates maken het leven nog een stuk handiger, voor mij de ideale situatie.
En een random tekst ophalen uit de database, dat kan met het volgende voorbeeldje:
Zorg dat er voldoende records in de tabel staan en je krijgt iedere keer een willekeurig resultaat. Even aanpassen aan je eigen wensen en klaar ben je.
Kan je mischien een beetje helpen?