Question arising from the previous question.

Maybe I have the wrong MVC design?

All requests go through the main index.php, CNC is used. It is written in htaccess that all requests are redirected to index.php. index.php transfers control to the router, which selects the required method from the url line; if the method does not exist, the View class displays: "not found". Right?

Further, in the admin folder is your index.php and your router, which processes not the NC, but simple links like /? Action = edit & target = main .

How to be? Do such "admin" requests pass through the main index.php or not? Is the site properly designed? And if it is correct, why can not I put the password on the admin folder?

UPDATE More precisely - the entrance to the site for example www.mysite.

Login to admin area - www.mysite / admin

  • In my opinion, the conclusion you made is quite true, what should 'admin' differ from other controllers in? It turns out that you are building 2 applications, although this seems to be wrong. Implement authorization using php (this will also help you log users, get a normal way to manage them, as well as store emails, names, etc.), add support for templates, so that the admin looks different and basically everything is. - zippp
  • @zippp, can you imagine that one-click hosting puts a password on a folder? I didn’t succeed (((. Yes, I’ll have to do it with php, I’m just wondering why htaccess isn’t working? The admin is created for only one person - the admin. That's all. - Deus
  • where do you put htaccess? in admin? Well, you write RewriteCond! ^ /? admin before RewriteCond! -f - zb '
  • one
    sorry, skype only for work (for money) - zb '
  • 3
    @Deus and you can imagine how you feel when you seem to have advised something sensible, and not "read a noob book" and you are answered "but do you imagine." Yes, I have a great idea, but I described to you the advantages of full authorization, which rises not per click, but in an hour or two with tests. If you so want to get everything separately, then imagine that it’s easy to make a subdomain "admin.domain_name.com" on your wonderful hosting, with access to the common database, in the settings specify the document root to it separate from your main application and set up authorization "in one click "as you like - zippp

1 answer 1

What does MVC have to do with it? I advise you to start to learn some popular MVC framework, for example http://kohanaframework.su/, in order to understand how everything should look and work.

  • one
    @ Anton Shamanov Listen to me, my friend, I am not interested in frameworks, x ... ki, etc. I am an amateur of "interesting" programming. And I asked an adequate question. Maybe you advise something to read and teach? Let's work in your profession, ok? - Deus
  • 2
    Do not poke strangers. What do you dislike about learning from someone else's successful experience? - Anton Shamanov
  • @ Anton Shamanov, sorry (those) for "you." I did not expect this from myself. But I didn’t expect this from you. - Deus