Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 10
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 11
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 12
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 13
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 14
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 15
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 16
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 17
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 18
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 19
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 22
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 23
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 24
Notice: Undefined variable: _post in C:\xampp\htdocs\HR\scripts\maak_account.php on line 25
Dit is mijn HTML code:
<!DOCTYPE html>
<html>
<head>
<?php include 'inc/head.php';?>
<link href="style/account.css" rel="stylesheet"/>
</head>
<body id="body-achtergrond">
<header class="container-fluid">
<h1>KMO-ADM</h1>
</header>
<nav class="container-fluid">
<?php include 'inc/navbar.php';?>
</nav>
<div class="container">
<div class="row">
<form action="scripts/maak_account.php" method="post">
<div class="col-md-4 col-md-offset-1">
<h2 id="titel">Gegevens bedrijf</h2>
<fieldset>
<div class="form-group">
<label for="rechtsvorm">Rechtsvorm:</label>
<select class="form-control" placeholer="Rechtsvorm" name="rechtsvorm">
<option>Eenmanszaak</option>
<option>VOF</option>
<option>BVBA</option>
<option>NV</option>
</select>
</div>
<div class="form-group">
<label for="naam">* Naam:</label>
<input class="form-control" placeholder="Naam" name="naam" type="text">
</div>
<div class="form-group">
<label for="straat">* Straat:</label>
<input class="form-control" placeholder="Straat" name="straat" type="text">
</div>
<div class="form-group">
<label for="huisnr">* Huis nummer:</label>
<input class="form-control" placeholder="Huis nummer" name="huisnr" type="text">
</div>
<div class="form-group">
<label for="busnr">Bus nummer:</label>
<input class="form-control" placeholder="Bus nummer" name="busnr" type="text">
</div>
<div class="form-group">
<label for="postcode">* Postcode:</label>
<input class="form-control" placeholder="Postcode" name="postcode" type="text">
</div>
<div class="form-group">
<label for="plaats">* Plaats:</label>
<input class="form-control" placeholder="Plaats" name="plaats" type="text">
</div>
<div class="form-group">
<label for="btwnr">* BTW nummer:</label>
<input class="form-control" placeholder="BTW nummer" name="btwnr" type="text">
</div>
<div class="form-group">
<label for="tel">Telefoon nummer:</label>
<input class="form-control" placeholder="Telefoon nummer" name="tel" type="text">
</div>
<div class="form-group">
<label for="email">* E-mail:</label>
<input class="form-control" placeholder="E-mail" name="email" type="text">
</div>
</fieldset>
</div>
<div class="col-md-4 col-md-offset-2">
<h2 id="titel">Gegevens gebruiker</h2>
<fieldset>
<div class="form-group">
<label for="vnaam">* Voornaam:</label>
<input class="form-control" placeholder="Voornaam" name="vnaam" type="text">
</div>
<div class="form-group">
<label for="naam">* Achternaam:</label>
<input class="form-control" placeholder="Achternaam" name="naam" type="text">
</div>
<div class="form-group">
<label for="functie">Functie:</label>
<input class="form-control" placeholder="Functie" name="functie" type="text">
</div>
<div class="form-group">
<label for="email">* E-mail:</label>
<input class="form-control" placeholder="E-mail" name="email" type="text">
</div>
<div class="form-group">
<label for="wachtwoord">* Wachtwoord:</label>
<input class="form-control" placeholder="Wachtwoord" name="wachtwoord" type="password">
</div>
<div class="form-group">
<label for="wachtwoord">* Bevestig wachtwoord:</label>
<input class="form-control" placeholder="Wachtwoord" name="wachtwoord" type="password">
</div>
</fieldset>
</div>
</div>
<div id="maak-account">
<input class="btn btn-success btn-lg" type="submit" value="Maak account">
</div>
</form>
</div>
</div>
<footer class="container-fluid">
<?php include 'inc/footer.php';?>
</footer>
</body>
</html>
Dit is mijn php code:
<?php
// Variabele gegevens bedrijf
$rechtsvorm = $naam = $straat = $huisnr = $busnr = $postcode = $plaats = $btwnr = $telnr = $email = "";
// Variabele gegevens gebruiker
$voornaam = $achternaam = $functie = $wachtwoord = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Gegevens bedrijf
$rechtsvorm = test_input($_post["rechtsvorm"]);
$naam = test_input($_post["naam"]);
$straat = test_input($_post["straat"]);
$huisnr = test_input($_post["huisnr"]);
$busnr = test_input($_post["busnr"]);
$postcode = test_input($_post["postcode"]);
$plaats = test_input($_post["plaats"]);
$btwnr = test_input($_post["btwnr"]);
$telnr = test_input($_post["telnr"]);
$email = test_input($_post["email"]);
// Gegevens gebruiker
$voornaam = test_input($_post["vnaam"]);
$achternaam = test_input($_post["naam"]);
$functie = test_input($_post["functie"]);
$wachtwoord = test_input($_post["wachtwoord"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
Ik heb al van alles geprobeerd maar krijg het niet aan de praat. $_POST blijft leeg en dus worden de variabele niet herkent. Maar de vraag is waarom? Ik zie de fout niet direct. Het zou fijn zijn als iemand mij even op weg kan helpen. Alvast bedankt!