Hallo I'm new to php. I'm having trouble with inserting information into the datebase.
I keep getting these notices:
Notice: Undefined variable: submit in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 8
Notice: Undefined variable: Toevoegen in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 8
Notice: Undefined variable: Voornaam in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Tussenvoegsel in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Achternaam in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Straat in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Nummer in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Postcode in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Notice: Undefined variable: Plaats in C:\Program Files\Apache Group\Apache2\htdocs\PHPKDS\persoon_toegevoegd.php on line 13
Duplicate entry '' for key 1
And this is my code:
<html>
<head>
</head>
<body>
<?php
include("dbconnect.php");
if ($submit == "$Toevoegen")
{
$query="insert into adresboek
(Voornaam,Tussenvoegsel,Achternaam,Straat,Nummer,Postcode,Plaats) values
('$Voornaam','$Tussenvoegsel','$Achternaam','$Straat','$Nummer','$Postcode','$Plaats')"
;
mysql_query($query) or
die (mysql_error());
?>
<h2>Thanks!!</h2>
<h2><a href="adresboek.php">View My Guest Book!!!</a></h2>
<?php
}
else
{
include("persoontoevoegen.php");
}
?>
</body>
</html>
Can someone help me pleassseee.