Okay, I changed my code for a few reasons which are irrelevant, but now I need your help again, since I'm very close on finishing one of first ''bigger'' projects in php and mysql, and I've changed my code to this:
<?php
if (isset($_POST['submitted'])) {
}
include('connect-with-mysql.php');
$Test1 = $_POST['test1'];
$Test2 = $_POST['test2'];
$sqlinsert = "INSERT INTO vanille"
?>
<html>
<head>
<title>Datenbank</title>
</head>
<body>
<h1>Überschrift</h1>
<form method="post" action="action.php">
<input type="hidden" name="submitted" value="true" />
<fieldset>
<legend>New Ppl</legend>
<label>Test1:<input type="text" name="test1" /></br>
<label>Test2:<input type="text" name="test2" /></br>
</fieldset>
<br />
<input type="submit" value="add new informations" />
</form>
</body>
</html>
EDIT:
Here's the content of the connect-with-mysql.php file:
<?php
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PSWD', '');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'vanille');
$dbcon = mysqli_connect(DB_HOST, DB_USER, DB_PSWD, DB_NAME);
?>
And then I'll get this error line:
Notice: Undefined index: test1 on line 11 (same with line 10)