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 981411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:32:20+00:00 2026-05-16T04:32:20+00:00

I’m not using any MVC framework and my application structure is rather simple… actions/

  • 0

I’m not using any MVC framework and my application structure is rather simple…

actions/
  registration.php
classes/
views/
  header.php
  footer.php
  registration.php
index.php

actions/registration.php

<?php
$variable = htmlspecialchars($_GET['name'], ENT_QUOTES).", are you ok!?";
include("views/registration.php");
?>

views/registration.php

<?php
include("header.php");
echo $variable;
include("footer.php");
?>

index.php is entrance, so, calling index.php?action=registration will execute actions/registration.php

As you can see, this structure is rather simple and I think that almost every php developer has used this structure at some point. Do you have any advice regarding this application structure? How would you realize modules using this structure? Do you know any open source applications using this structure to explore?

  • 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-05-16T04:32:21+00:00Added an answer on May 16, 2026 at 4:32 am

    The main problem I see is that you’re going to do a lot of repeating yourself.

    If your actions and views are doing similar things, they’re going to maintain nearly duplicate code, which after 5 or 6 years can become a monstrous nightmare.

    I have a project inherited from 2001 (back when an include flat-scripts idea was one of the more common ways of separating tasks in PHP) that has a similar structure. Now, after 9 years, here’s a summary:

    vlad:~/workspace/myproj% find . -name '*.php' | wc -l
    4357
    vlad:~/workspace/myproj% du -hs
    1.8G    .
    

    You can imagine how fun it is to try and pick through this.

    Even if you manage to successfully separate all of your actions into the appropriate flat files, you’re still losing out in that data isn’t compartmentalized properly, and therefore can’t be shared across the entire app in an organized way. Essentially, without using classes to manage your organization, and functions to control what actions can effect which data, you’re setting yourself up for a pile of spaghetti code once your app thrives and grows. In addition, you’re going to end up with an app where 1/3 of the lines of your code are include statements, none of which really indicate what’s going on directly. This can lead to confusing wild goose chases while hunting down bugs.

    You may want to take a gander at http://wshell.wordpress.com/2009/10/12/encapsulation-in-php/, which appears to take a good look at why your organizational model may be a bad idea. There’s also the ever-fantastic developerWorks articles, one of which covers some good habits to get into as your project grows: http://www.ibm.com/developerworks/opensource/library/os-php-7oohabits/

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

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Constructor chaining works like that : public TestObject(Data.MyDataTable table) :… May 16, 2026 at 2:27 pm
  • Editorial Team
    Editorial Team added an answer You probably wouldn't want to create new tables, the data… May 16, 2026 at 2:27 pm
  • Editorial Team
    Editorial Team added an answer There are a number of Ruby-level libraries to access remote… May 16, 2026 at 2:27 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
In order to apply a triggered animation to all ToolTip s in my app,
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm looking for suggestions for debugging... If you view this site in Firefox or
I am currently running into a problem where an element is coming back from
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a JSP page retrieving data and when single or double quotes are

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.