I'm trying to apply a simple MVC pattern to my current website without any frameworks. Since i havent really gotten into oop yet im still using procedural at the moment.
i have a simple login form (view)
<form action="controller/login.php" method="Post">
<input type="text" name="username" placeholder="Username" />
<input type="text" name="password" placeholder="Password" />
<input type="submit" value="Sign in" />
this form will submit to the controller for login form. Controller will now check if both fields have inputs and "cleanse" more or less the input
$username = $_POST['username'];
$password = $_POST['password'];
$username_escape = mysqli_real_escape_string($connect, $username);
$password_escape = mysqli_real_escape_string($connect, $password);
this is a really simple check right now however i was now wondering should i include controller into model and redirect to model from controller or form submit it at first place and have controller included.
$query = mysqli_query($connect, "INSERT into DB_table (username, password)