Well, I'm starting the studies in php and mysql, and I'm having a hard time doing something theoretically simple, which would be a form that sends the information provided to a local db. When pressing send, nothing happens, the db table remains intact. Thanks in advance for the time you have to help me
<?php
session_start();
$mysqli = new mysqli('localhost', 'root', '', 'dbteste');
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if($_POST['password'] == $_POST['confirmpassword']){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password']; //md5 hash passwor security
$sql = "INSERT INTO user (username, password, email) VALUES($username, $password, $email)";
$mysqli->query($sql);
}
}
?>
<h1>Register</h1>
<form class="form" action="create-account.php" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="text" name="username" value="" placeholder="username" required/>
<input type="password" name="password" value="" placeholder="password" required/>
<input type="password" name="confirmpassword" value="" placeholder="confirm password" required/>
<input type="text" name="email" value="" placeholder="e-mail" required/>
<input type="submit" name="createacount" value="create acount">
</form>