Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7799143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:12:46+00:00 2026-06-02T00:12:46+00:00

I am building a simple user registration form using the MVC design pattern, in

  • 0

I am building a simple user registration form using the MVC design pattern, in PHP.

Can someone please advise if I have selected the correct areas for code implementation, as after some fair amount of reading I understand people often interpret the docs in different ways.

I understand there may be no wright / wrong answer here, but am just trying to get some feedback on how the majority would implement it.

Many thanks.

Model
Function containing PDO mysql insert query

View
HTML form markup with PHP self action and controller include

Controller
Data validation and php include of model function

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:12:49+00:00Added an answer on June 2, 2026 at 12:12 am

    yup there are different approaches to MVC… your concepts look correct except for the view which should not contain the controller include. It is the controller that includes the model and view. Furthermore, i would have put validations in the model itself.

    Model : validation functions(return true or false if error) and insert query

    View : html form only with data passed from controller

    Controller: main entry point/file (e.g. registration.php)

    The controller is the entry point which is where you include your view and model.

    Basically in the controller,

    you check if form is submitted or not.

    If not submitted, display the view (i.e. the form)

    if data submitted, do validation using model’s validation functions.

    If validation ok, execute sql in your model and redirect to success page or display a success message.

    If validation is not correct, display your view and fill in your form with the submitted data.

    But as i said, there are different approaches to MVC; e.g. you can do all validations in the controller itself instead of the model like you proposed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a simple user registration and information update forms which have a lot
I'm building simple dictionary application using WPF. I'm using MVVM pattern, databinding and FlowDocument
I'm building a simple mvc3 app using jqgrid. My form currently calls a function
I'm building a simple wallpaper app where the user can browse through a selection
I'm building a simple signup application on my website with user database. I'm using
I'm building a simple API using django-tastypie. The idea is I have two resources:
I'm building a simple form mailer in symfony using sfExtraForm plugin captcha. Everything works
I'm building a simple application. It's a user interface to an online order system.
I'm building a simple java Servlet which passes categories using a URL variable into
i'm building a simple school portal, i have stucked at uploading an image into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.