ik heb een gastenboek
alleen bij de check doet hij raar
dit is de post / check:
en als ik een bericht langer dan 5 tekens invul
zegt hij van niet
alleen bij de check doet hij raar
dit is de post / check:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]toevoegen[/COLOR][COLOR= #007700]]) &&[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br/><div class="rederror">Vul een bericht in!</div><br/>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] <[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br/><div class="rederror">Je bericht moet langer dan 5 tekens zijn!</div><br/>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] >[/COLOR][COLOR= #0000BB]99[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br/><div class="rederror">Je bericht mag niet langer dan 100 tekens zijn!</div><br/>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
INSERT INTO
gastenboek
(
bericht,
userid,
gastenboek_id
)
VALUES
(
"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]",
"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]",
"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]"
)
"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="greenerror">Je bericht is succesvol toevoegd.</div><meta http-equiv="refresh" content="3; URL=?p=profiel&id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];
}
}[/COLOR]
?> en als ik een bericht langer dan 5 tekens invul
zegt hij van niet
oplossing: