I have created a login system and I am trying to stick to the rules of MVC as much as possible.
I have a simple login form that uses AJAX to submit the form data to small script, which then calls the controller for the processing of the username and password:
function __autoload($classname) {
include("../classes/$classname.php");
}
$username = $_POST['username'] ;
$password = $_POST['password'] ;
$AC = new AccessControl ;
$result = $AC->login($username, $password) ;
if($result !== 0)
{
echo $result ;
exit() ;
}
AccessControl is my class for user authentication and account management operations, the code is here in my other post: MVC Relationships and DRY
Have I done this wrong because this small script isn't a controller or a model? All it does is relay information returned from the controller back to the interface/view, such as error messages.