Home Ask Login Register

Developers Planet

Your answer is one click away!

T91 February 2016

PHP MVC Basics for login form

Im new to the forum and new to MVC. I know the basics of PHP and have made a simple PHP website. I now want to create a website that follows an MVC patter, atleast in its simplest form.

Would i be correct in assuming that, if for example we had a login for, the Model would contain the SQL select statements, the controller would handle the data e.g if (isset($_POST["username"])) { and the view would contain the basic HTML form where the user would enter the data?

Any information will be appreciated Thanks!


Bear February 2016

Those assumptions are correct, I would recomend taking a look at an existing MVC framework such as tinymv if you just want the MVC pattern or CakePHP if you want a bunch of other features as well . Then there are plenty of other alternatives.

Post Status

Asked in February 2016
Viewed 3,117 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life