Search code examples
phpmysqlgithubmamp

sub directory conundrum


I noticed the 'path-styled' links in the headers of the github pages and wondered if it is an indication to create a sub directory. https://github.com/panique/php-login-minimal/blob/master/classes/Login.php

include("views/not_logged_in.php");

I am assuming this is a reference to the sub directory? I noticed this when parsing the index.php file.

My question is the title; should I create a sub directory for this application in addition to htdocs? And if so is theory 1 correct?

theory 1 create a new folder named 'php-login-minimal'and create a 'classes' folder + a 'config' folder + a 'libraries' folder + a 'views' folder and ultimately save 'php-login-minimal' to htdocs?


Solution

  • Typical structure is htdocs is your root folder, inside of that you add sub-folders for your resources/other pages. So one for style, one for js, config and so on. This allows simpler control, and better security options for things like htaccess.