My code:
rek.php:
database.php:
I'm expecting it to add a row with the "gebruikersnaam" and "wachtwoord" into the data table but everytime I click on submit I just get redirected to rek.php and thats it, the data doesn't get added to the db. What am I doing wrong? And is there any way that I can send info to the db without getting redirected to another page (rek.php in this case).
One of the first times doing PHP, so excuse me if this is a nooby question lol
Code
<form action="admin/rek.php" method="POST" autocomplete="off">
<div class="input-container underlined">
<div class="underline-container">
<input id="username" class="material-input custom-focus" autocomplete="off" autocapitalize="off" type="text" name="gebr" placeholder="Gebruikersnaam" required="">
<div class="highlight-underline"></div>
<div class="base-underline"></div>
</div>
</div>
<div class="input-container underlined">
<div class="underline-container">
<input id="password" class="material-input custom-focus" autocomplete="off" autocapitalize="off" type="password" name="ww" required="" placeholder="Wachtwoord">
<div class="highlight-underline"></div>
<div class="base-underline"></div>
</div>
</div>
<div class="login-call-to-actions">
<button type="submit" id="submitButton" class="material-button orange"><span class="msie-button-fix">Inloggen</span>
<div class="rippleJS"></div>
</button>
</form>rek.php:
Code
<?php include("db/database.php");
$gebruiker = $_POST['gebr'];
$wachtw = $_POST['ww'];
mysqli_query($connect, "INSERT INTO 'data' ('gebruikersnaam', 'wachtwoord')
VALUES ($gebruiker, $wachtw)");
?>database.php:
Code
<?php
$connect = mysqli_connect("localhost", "root", "", "proj");
?>I'm expecting it to add a row with the "gebruikersnaam" and "wachtwoord" into the data table but everytime I click on submit I just get redirected to rek.php and thats it, the data doesn't get added to the db. What am I doing wrong? And is there any way that I can send info to the db without getting redirected to another page (rek.php in this case).
One of the first times doing PHP, so excuse me if this is a nooby question lol




![[Image: fpZ5a5g.png]](https://i.imgur.com/fpZ5a5g.png)