0

According to the MVC concept, the users of the website should not see any logic involved in the website development. But if we look at the pset7, for example, there are files like buy.php, sell.php and others, which do contain the logic but are still visible to the users. It is clear for me that we cannot avoid it, since we need to access them directly by clicking appropriate links in the menu. I would expect some workarounds for this.

So, relatively to pset7:

Is it necessary to hide them, and if so, how?

Which information exactly we want to hide?

Which files should be really visible to the users?

Which files must be stored in the public directory?

0
0

If buy.php and sell.php have the permissions 600, they are NOT readable by the users. When the user requests any of these pages, the PHP code inside them is never revealed to the user. Rather, it is interpreted on the server and the results are sent to the user.

Which information exactly we want to hide?

Generally, the logic of your web application. As a very silly example, if your web application takes 3 as input and returns 6, the user shouldn't know whether your application added the 3 to itself or multiplied it by 2.

Which files should be really visible to the users?

As the pset specification page denotes, HTML, CSS, and JavaScript files should be readable by the user.

Which files must be stored in the public directory?

Your controllers (i.e., the programs that server as an intermediate layer between your model (e.g., the database) and the view (e.g., the user interface).

3
  • Thank you for your answer. It was confusing, since in the pset7 manual it says that all files in public must be world readable. But as I can now see it is not really necessary.
    – user2477
    Feb 25 '15 at 8:48
  • @Alexandr actually the pset specification page says "Finally, ensure that the files within those directories are world-readable by executing the below." in a reference for the files that are within css, fonts, img, and js.
    – kzidane
    Feb 25 '15 at 10:02
  • Probably, I misunderstood it.
    – user2477
    Feb 25 '15 at 14:06

You must log in to answer this question.