Form
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
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
$form = "
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='<?php if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } ?>'>
</tr>
</table>
</form>
</div>";
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='<?php if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } ?>'>
</tr>
</table>
</form>
</div>";
weet iemdan wat er verkeerd aan is ik krijg deze error:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/gtaweb/public_html/maarten/gastenboek.php on line 107
Patrick Niezen
Edit: typefout, en ps: wordt ook een stuk duidelijker in je if-else structuur als je deze goed laat inspringen ipv aan elkaar knoopt.
Gewijzigd op 01/01/1970 01:00:00 door Patrick Niezen
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
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
$form = "
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='" if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } "'>
</tr>
</table>
</form>
</div>";
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='" if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } "'>
</tr>
</table>
</form>
</div>";
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
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
<?php
/**
* @author Prabhjeet Singh
* @copyright 2008
*/
$form = '
<div align="center">
<form method="post" name="post" action="'.$_SERVER['PHP_SELF'].'">
<table>
<tr>
<td align="center"><font color="#000000" face="arial">Naam</font></td>
<td align="center"><input type="text" name="naam" size="38"></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center">
<input type="button" value="Smilies" name="smiles" style="float: left" onclick="window.open(\'smiles.php\', \'Smilies\', \'width=180px;, height=150px;\'); return false\"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Bericht</font></td>
<td align="center"><textarea name="bericht" cols="33" rows="7"></textarea></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Code</font></td>
<td align="center"><img border="1" src="captcha.php"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial"></font></td>
<td align="center"><input type="text" name="controlcode" size="38"></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align="center"><input type="submit" name="posten" value="';
if (isset($_GET["lang"])) {
if($_GET["lang"]=="nl"){
echo "Versturen";
}
if($_GET["lang"]=="en"){
echo "Send";
}
if($_GET["lang"]=="de"){
echo "Senden";
}
}
else {
echo "Versturen";
}
echo '">
</tr>
</table>
</form>
</div>';
?>
/**
* @author Prabhjeet Singh
* @copyright 2008
*/
$form = '
<div align="center">
<form method="post" name="post" action="'.$_SERVER['PHP_SELF'].'">
<table>
<tr>
<td align="center"><font color="#000000" face="arial">Naam</font></td>
<td align="center"><input type="text" name="naam" size="38"></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center">
<input type="button" value="Smilies" name="smiles" style="float: left" onclick="window.open(\'smiles.php\', \'Smilies\', \'width=180px;, height=150px;\'); return false\"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Bericht</font></td>
<td align="center"><textarea name="bericht" cols="33" rows="7"></textarea></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Code</font></td>
<td align="center"><img border="1" src="captcha.php"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial"></font></td>
<td align="center"><input type="text" name="controlcode" size="38"></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align="center"><input type="submit" name="posten" value="';
if (isset($_GET["lang"])) {
if($_GET["lang"]=="nl"){
echo "Versturen";
}
if($_GET["lang"]=="en"){
echo "Send";
}
if($_GET["lang"]=="de"){
echo "Senden";
}
}
else {
echo "Versturen";
}
echo '">
</tr>
</table>
</form>
</div>';
?>
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
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
<?php
$form = "
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='" if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } "'>
</tr>
</table>
</form>
</div>";
?>
$form = "
<div align='center'>
<form method='post' name='post'>
<table>
<tr>
<td align='center'><font color='#000000' face='arial'>Naam</font></td>
<td align='center'><input type='text' name='naam' size='38'></td>
</tr>
<tr>
<td align='center'> </td>
<td align='center'>
<input type='button' value='Smilies' name='smiles' style='float: left' onclick=\"window.open('smiles.php', 'Smilies', 'width=180px;, height=150px;'); return false\"></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Bericht</font></td>
<td align='center'><textarea name='bericht' cols='33' rows='7'></textarea></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'>Code</font></td>
<td align='center'><img border='1' src='captcha.php'></td>
</tr>
<tr>
<td align='center'><font color='#000000' face='arial'></font></td>
<td align='center'><input type='text' name='controlcode' size='38'></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align='center'><input type='submit' name='posten' value='" if (isset($_GET["lang"])) { if($_GET["lang"]=="nl") { echo "Versturen"; } if($_GET["lang"]=="en") { echo "Send"; } if($_GET["lang"]=="de") { echo "Senden"; } } else { echo "Versturen"; } "'>
</tr>
</table>
</form>
</div>";
?>
En zo zie je dit dus het beste met kleurtjes. Ga nu crispijn zijn reactie nog eens af.
Robert deiman was me voor :)
Gewijzigd op 01/01/1970 01:00:00 door Wouter K
Gewijzigd op 01/01/1970 01:00:00 door mvos
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
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
<?php
// Bepaal de voertaal
$lang = "nl";
if(isset($_GET['lang']))
$lang = $_GET['lang'];
// Initieer formulier values
switch($lang) {
case 'de':
$submit_value = "Senden";
break
case 'en':
$submit_value = "Send";
break;
case 'nl':
default:
$submit_value = "Versturen";
break;
}
// Initieer formulier
$form = '
<div class="formulier_container">
<form name="formulier" action="<!-- target url -->" method="POST">
<table class="bericht_formulier">
<tr>
<td><!-- Label --></td>
<td><!-- Input --></td>
</tr>
<!-- etc. -->
<tr>
<td><!-- No contents</td>
<td><input type="submit" name="bericht_formulier_submit" value="' . $submit_value . '"/></td>
</tr>
</table>
</form>
</div>';
// Doe wat met het formulier
?>
// Bepaal de voertaal
$lang = "nl";
if(isset($_GET['lang']))
$lang = $_GET['lang'];
// Initieer formulier values
switch($lang) {
case 'de':
$submit_value = "Senden";
break
case 'en':
$submit_value = "Send";
break;
case 'nl':
default:
$submit_value = "Versturen";
break;
}
// Initieer formulier
$form = '
<div class="formulier_container">
<form name="formulier" action="<!-- target url -->" method="POST">
<table class="bericht_formulier">
<tr>
<td><!-- Label --></td>
<td><!-- Input --></td>
</tr>
<!-- etc. -->
<tr>
<td><!-- No contents</td>
<td><input type="submit" name="bericht_formulier_submit" value="' . $submit_value . '"/></td>
</tr>
</table>
</form>
</div>';
// Doe wat met het formulier
?>
Edit: Damnit :P jullie zijn mij allemaal voor!
Gewijzigd op 01/01/1970 01:00:00 door Patrick Niezen
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
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
<?php
/**
* @author Prabhjeet Singh
* @copyright 2008
*/
$form = '
<div align="center">
<form method="post" name="post" action="'.$_SERVER['PHP_SELF'].'">
<table>
<tr>
<td align="center"><font color="#000000" face="arial">Naam</font></td>
<td align="center"><input type="text" name="naam" size="38"></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center">
<input type="button" value="Smilies" name="smiles" style="float: left" onclick="window.open(\'smiles.php\', \'Smilies\', \'width=180px;, height=150px;\'); return false\"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Bericht</font></td>
<td align="center"><textarea name="bericht" cols="33" rows="7"></textarea></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Code</font></td>
<td align="center"><img border="1" src="captcha.php"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial"></font></td>
<td align="center"><input type="text" name="controlcode" size="38"></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align="center"><input type="submit" name="posten" value="';
if (isset($_GET["lang"])) {
if($_GET["lang"]=="nl"){
echo "Versturen";
}
if($_GET["lang"]=="en"){
echo "Send";
}
if($_GET["lang"]=="de"){
echo "Senden";
}
}
else {
echo "Versturen";
}
echo '">
</tr>
</table>
</form>
</div>';
?>
/**
* @author Prabhjeet Singh
* @copyright 2008
*/
$form = '
<div align="center">
<form method="post" name="post" action="'.$_SERVER['PHP_SELF'].'">
<table>
<tr>
<td align="center"><font color="#000000" face="arial">Naam</font></td>
<td align="center"><input type="text" name="naam" size="38"></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center">
<input type="button" value="Smilies" name="smiles" style="float: left" onclick="window.open(\'smiles.php\', \'Smilies\', \'width=180px;, height=150px;\'); return false\"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Bericht</font></td>
<td align="center"><textarea name="bericht" cols="33" rows="7"></textarea></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial">Code</font></td>
<td align="center"><img border="1" src="captcha.php"></td>
</tr>
<tr>
<td align="center"><font color="#000000" face="arial"></font></td>
<td align="center"><input type="text" name="controlcode" size="38"></td>
</tr>
<tr>
<td><!-- No contents --></td>
<td align="center"><input type="submit" name="posten" value="';
if (isset($_GET["lang"])) {
if($_GET["lang"]=="nl"){
echo "Versturen";
}
if($_GET["lang"]=="en"){
echo "Send";
}
if($_GET["lang"]=="de"){
echo "Senden";
}
}
else {
echo "Versturen";
}
echo '">
</tr>
</table>
</form>
</div>';
?>
werkt niet, weet iemand anders nog een oplossing
Errors?
ik heb het op dit moment op de maniet van Robert Deiman alleen daar geeft hij geen errors maar hij weergeeft de form niet het enige wat hij in de pagina weergeeft is: Versturen">
$form = '....
verandert in
echo '.....
dan doet ie het.
bedankt het werkt:)
En als je in de code van Robert echo '... verandert in $form .= '... zit 'ie ook nog eens in $form!