ik heb deze code:
en als ik verstuur krijg ik in DB:
hoe komen die 0en daar?
SQL:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"header.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
<h2>contact opnemen</h2>
<form name="contact" id="1" method="post" action="?verzend">
wat is uw naam?<br />
<INPUT TYPE="text" NAME="naam" VALUE="uw naam"><br />
wat is het onderwerp?<br />
<INPUT TYPE="text" NAME="vraag" VALUE="onderwerp hierzo"><br />
wat is uw bericht?<br />
<input NAME="verhaal" type="text" VALUE="bericht hierzo"><br />
klik op verstuur om uw bericht te versturen<br />
<INPUT TYPE="submit" NAME="submit" VALUE="verstuur"><br />
</FORM>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO `contact` (id, naam, vraag, verhaal) VALUES (NULL, "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vraag[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verhaal[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/print"]print[/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]" Succesvol bericht verstuurd"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?> en als ik verstuur krijg ik in DB:
id naam vraag verhaal
1 0 onderwerp hierzo 0 hoe komen die 0en daar?
SQL:
CREATE TABLE IF NOT EXISTS `contact` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`naam` int(11) NOT NULL,
`vraag` text NOT NULL,
`verhaal` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;