unexpected $end
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
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
<?php
$gbQuery = mysql_query("SELECT id,hoogte,breedte FROM gastenboeken WHERE admin_id = '" . $gFetch['id'] . "'") or die(mysql_error());
$gbFetch = mysql_fetch_assoc($gbQuery);
?>
<div style="height: <?=$gbFetch['hoogte'];?>px; width: <?=$gbFetch['breedte'];?>px; overflow: auto;">
<?php
$gbrQuery = mysql_query("SELECT * FROM gastenboek_berichten WHERE gast_id = '" . $gbFetch['id'] . "' ORDER BY gepostop DESC LIMIT 5") or die(mysql_error());
while ($gbrFetch = mysql_fetch_assoc($gbrQuery))
{
?>
<?=$gbrFetch['poster'];?> plaatste op <?=datenl($gbrFetch['gepostop']);?><br />
<?=smilies($gbrFetch['bericht']);?>
<?php
}
if (isset($_SESSION['login']))
{
if (isset($_POST['submit']))
{
$bericht = mysql_real_escape_string($_POST['bericht']);
$user = mysql_real_escape_string($_SESSION['login']);
mysql_query("INSERT INTO gastenboek_berichten (gast_id,poster,tekst,gepostop) VALUES ('" . $gbFetch['id'] . "','" . $user . "','" . $bericht . "',NOW())") or die(mysql_error());
error('green','Je bericht is toegevoegd!');
}
?>
<form action="#" method="post">
<textarea name="bericht"></textarea><br />
<input type="submit" name="submit" value="Bericht plaatsen" />
</form>
</div>
</div>
</body></html>
op de laatste regel krijg ik een unexpected $end error
Ik doe toch niks fout?
Mvg
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
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
<?php
$gbQuery = mysql_query("SELECT id,hoogte,breedte FROM gastenboeken WHERE admin_id = '" . $gFetch['id'] . "'") or die(mysql_error());
$gbFetch = mysql_fetch_assoc($gbQuery);
?>
<div style="height: <?=$gbFetch['hoogte'];?>px; width: <?=$gbFetch['breedte'];?>px; overflow: auto;">
<?php
$gbrQuery = mysql_query("SELECT * FROM gastenboek_berichten WHERE gast_id = '" . $gbFetch['id'] . "' ORDER BY gepostop DESC LIMIT 5") or die(mysql_error());
while ($gbrFetch = mysql_fetch_assoc($gbrQuery))
{
?>
<?=$gbrFetch['poster'];?> plaatste op <?=datenl($gbrFetch['gepostop']);?><br />
<?=smilies($gbrFetch['bericht']);?>
<?php
}
if (isset($_SESSION['login']))
{
if (isset($_POST['submit']))
{
$bericht = mysql_real_escape_string($_POST['bericht']);
$user = mysql_real_escape_string($_SESSION['login']);
mysql_query("INSERT INTO gastenboek_berichten (gast_id,poster,tekst,gepostop) VALUES ('" . $gbFetch['id'] . "','" . $user . "','" . $bericht . "',NOW())") or die(mysql_error());
error('green','Je bericht is toegevoegd!');
}
}
?>
$gbQuery = mysql_query("SELECT id,hoogte,breedte FROM gastenboeken WHERE admin_id = '" . $gFetch['id'] . "'") or die(mysql_error());
$gbFetch = mysql_fetch_assoc($gbQuery);
?>
<div style="height: <?=$gbFetch['hoogte'];?>px; width: <?=$gbFetch['breedte'];?>px; overflow: auto;">
<?php
$gbrQuery = mysql_query("SELECT * FROM gastenboek_berichten WHERE gast_id = '" . $gbFetch['id'] . "' ORDER BY gepostop DESC LIMIT 5") or die(mysql_error());
while ($gbrFetch = mysql_fetch_assoc($gbrQuery))
{
?>
<?=$gbrFetch['poster'];?> plaatste op <?=datenl($gbrFetch['gepostop']);?><br />
<?=smilies($gbrFetch['bericht']);?>
<?php
}
if (isset($_SESSION['login']))
{
if (isset($_POST['submit']))
{
$bericht = mysql_real_escape_string($_POST['bericht']);
$user = mysql_real_escape_string($_SESSION['login']);
mysql_query("INSERT INTO gastenboek_berichten (gast_id,poster,tekst,gepostop) VALUES ('" . $gbFetch['id'] . "','" . $user . "','" . $bericht . "',NOW())") or die(mysql_error());
error('green','Je bericht is toegevoegd!');
}
}
?>
je had een } vergeten
Gewijzigd op 03/03/2011 18:49:04 door Dindong Veter
Want in een andere pagina precies hetzelfde, maar dan unexpected }
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
HIER KRIJG IK DIE ERROR ---> }else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
}
} else {
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
HIER KRIJG IK DIE ERROR ---> }else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
}
} else {
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
} else {
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
} else {
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
nu staat er T Else en dat is in jou script op regel 10.
Gewijzigd op 03/03/2011 19:26:32 door - SanThe -
Edit: Je query is overigens ook niet goed. Als je een WHERE in je query wilt gebruiken dan zul je dit met AND moeten doen, als volgt:
Code (php)
1
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' AND profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
Gewijzigd op 03/03/2011 19:29:53 door Kevin de Groot
Kevin de Groot op 03/03/2011 19:26:13:
Ik vermoed dat daarboven weer een if-voorwaarde staat. Kun je anders de gehele code plaatsen?
Dan zou er een } missen.
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
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
<?php
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
}else{
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if(isset($_POST['submit'])) {
mysql_query("UPDATE leden SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "', welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "', slogan = '" . mysql_real_escape_string($_POST['slogan']) . "', overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}else{
mysql_query("UPDATE leden SET email = '" . mysql_real_escape_string($_POST['email']) . "', rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "', onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "' WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "', profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
}else{
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
Je hebt het antwoord al gekregen.
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
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
<?php
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if ( isset($_POST['submit']) )
{
mysql_query("UPDATE leden
SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "',
welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "',
slogan = '" . mysql_real_escape_string($_POST['slogan']) . "',
overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}
else
{
mysql_query("UPDATE leden
SET email = '" . mysql_real_escape_string($_POST['email']) . "',
rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "',
onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "'
WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "'
AND profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if ( isset($_POST['submit']) )
{
mysql_query("UPDATE leden
SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "',
welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "',
slogan = '" . mysql_real_escape_string($_POST['slogan']) . "',
overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}
else
{
mysql_query("UPDATE leden
SET email = '" . mysql_real_escape_string($_POST['email']) . "',
rang2 = '" . mysql_real_escape_string($_POST['rang2']) . "',
onderschrift = '" . mysql_real_escape_string($_POST['onderschrift']) . "'
WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "'
AND profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'") or die(mysql_error());
echo '<div id="greenerror"><center>Opgeslagen</center></div>';
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
Edit: Tevens mis je in de query die begint op lijn 15 een WHERE.
Gewijzigd op 03/03/2011 19:45:43 door Kevin de Groot
Trouwens, ik hoef maar 1 query?
Een een dubbele quote te veel in <form>.
Lijkt me wel, ja. Heb de code voor de rest enkel bekeken op fouten, niet op logica :) Volgens mij kan die tweede update-query weg.
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
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
<?php
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if ( isset($_POST['submit']) )
{
mysql_query("UPDATE leden
SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "',
welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "',
slogan = '" . mysql_real_escape_string($_POST['slogan']) . "',
overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'
profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'
WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}
else
{
echo '';
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
include ("config.php");
define("TITLE", "Profiel instellingen");
layoutboven();
checklogin();
echo '<div id="yellowerror" style="height: auto;">Profiel instellingen';
if ( isset($_POST['submit']) )
{
mysql_query("UPDATE leden
SET weergavenaam = '" . mysql_real_escape_string($_POST['weergavenaam']) . "',
welkomsttekst = '" . mysql_real_escape_string($_POST['welkomsttekst']) . "',
slogan = '" . mysql_real_escape_string($_POST['slogan']) . "',
overmij = '" . mysql_real_escape_string($_POST['overmij']) . "'
profieltekst = '" . mysql_real_escape_string($_POST['profieltekst']) . "'
WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "'") or die(mysql_error());
error('green','Opgeslagen');
}
else
{
echo '';
$uQuery = mysql_query("SELECT * FROM leden WHERE naam = '" . mysql_real_escape_string($_SESSION['login']) . "' ") or die(mysql_error());
$uFetch = mysql_fetch_assoc($uQuery);
?>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "imagemanager"
});
</script>
<?php
echo '<form action="#" method="post" enctype="multipart/form-data"">
Weergave naam (log hier niet mee in!):<br>
<input type="text" name="weergavenaam" value="' . $uFetch['weergavenaam'] . '"/><br>
Welkomst Tekst:<br>
<input type="text" name="welkomsttekst" value="' . $uFetch['welkomsttekst'] . '"/><br>
Slogan:<br>
<input type="text" name="slogan" value="' . $uFetch['slogan'] . '"/><br>
Over mij:<br>
<input type="text" name="overmij" value="' . $uFetch['overmij'] . '"/><br>
Extra/Groot profiel tekst:<br />
<textarea style="width: 100%;" cols="10" name="profieltekst">' . $uFetch['profieltekst'] . '</textarea><br />
<input type="submit" name="submit" value="Opslaan" />
</form><br />
<br />
';
}
;
?>
</div>
<?php layoutonder(); ?>
Ok bedankt.
Maar ik krijg nog wel een error,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'profieltekst = '
Weet jij waar dat aan ligt?
De regel er voor heb je geen , op het einde.
Vincent Huisman op 03/03/2011 19:53:27:
De regel er voor heb je geen , op het einde.
Klopt, regel 19 :)
Werkt Super!
Succes ermee :)