My register form was working properly, than in my index.php I changed all mysql functions to mysqli functions and now it does not work anymore. Register.php code:
<?php
require('config.php');
session_start();
// If the values are posted, insert them into the database.
if (isset($_POST['username']) && isset($_POST['password'])){
$username = htmlEntities($_POST['username'],ENT_QUOTES);
$password = htmlEntities($_POST['password'],ENT_QUOTES);
$query = "INSERT INTO `users` (username, password) VALUES ('$username', '$password')";
$result = mysqli_query($connect, $query);
if($result){
header("Location:index.php");
}
else
{
echo "Het werkt niet!";
}
}
?>