I created in practice a simple project in php, where you need to fill in a culinary database in forms and look through tables from this database, it looks like a bunch of php files in one folder. I was told that projects do not do that, that it is necessary to have some kind of .htaccess file, all functions in one file, so that everything is neat, etc. I think knowledgeable people understand how everything should look and what kind of porridge I made.

We need an example of creating a web project according to all modern rules.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants D-side , cheops , VenZell , aleksandr barakin , Kromster 9 Jun '16 at 5:38 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    “All functions in one file” - this is heresy told you. There should be one entry point and link parsing (aka routing) in php itself (thus we get apache independence), and .htaccess should only redirect all requests to this very entry point. In php-code, however, the logic and presentation (html-code) should be separated in some way (for example, MVC) and all this is logically crammed into different php-files so that it is convenient to read and edit. During the night, do not alter. Details in google. A lot of instructions. - andreymal
  • I have a small school project. Well, imagine in delphi a small form with fields for filling / displaying a simple database, this is all in the web. Said overnight just real. - unit
  • 2
    This is realistic to do even in an hour, but only if you learn in advance, and learn not in one night :) - andreymal
  • There are tons of information in Google, I don’t know from which side to even get close to it, maybe there is a template with comments? - unit
  • Any framework. - andreymal

1 answer 1

I think this will save the father of Russian democracy:

The organization of the address space of the website pages using PHP and MySQL / MariaDB

The article presents an approach in which requests to the site are processed centrally (through a single PHP file), and the addresses and contents of the pages are stored in the database. In this case, the page address may be dynamic, and the content - include labels for variable substitution. The page can also be assigned executable PHP code.

  • Thanks, it seems like what I need to do! - unit