How do I structure folders for users logged in and logged out?
I want the user's profile to show everything (logged in navbar, textbox they use to post their content on and all of their content) and then show their profile with a logged out navbar, selected content the user wants to show and no textbox to post content.
I am breaking up the html files (eg header, footer and main content) into separate php files. Is that a good idea if I want to implement the above said ?
I'm still developing on localhost but here's the current file structure which is a bit messy. I'm also trying to implement MVC but due to my lack of knowledge so far, it hasn't been done.
However you seem fit, but nice practice could be dividing up backend / frontend. Or have a public and a private directory as top layer, then go from there.
And yes, breaking up your files in header.php, *content.php and footer.php is smart for what you want. By doing this, you allow yourself to edit the main parts of you page independently, without having to update many html or php files. Just one file will do for every page.
Also google stuff like "common practice" for php structures. Account for REST in your workflow How to create a RESTfull api
This Stackoverflow on html/php inlining is also usefull maybe.
链接地址: http://www.djcxy.com/p/46202.html下一篇: 如何为登录和注销的用户构建文件夹?