php - Website Structure -


I'm very new to php and I'm trying to decide the best way to organize pages, and Using PHP, deliver them. I have two basic ideas:

  • A bunch of different pages with PHP are with header, footer, and menu.

  • A main page that contains a menu for the main content, including the headers and footers comes from a variable in the URL of the page's name.

Do anyone have any other suggestions or ideas? It's very basic stuff, but I think that anyone has a better idea if I'm looking.

Thanks

I have gone in both directions before, and although both of them Near professional and cons are I bent towards their second option, a main page that has a layout, how the master page works in the publications of this desktop page, and this is a good implementation of the idea of ​​ASP.net - it is not so. That I am saying that you have to change the technologies.

However, if you do this, instead of the query strings in your URL, use the mod_rewrite to get your path into the PHP master page. Your .htaccess file should contain something like this:

  Rewrite code on rewriting% {REQUEST_FILENAME} -f [OR] Rewrite Row% {REQUEST_FILENAME} -d Records Rules ^. * $ - [S = 1] Rewrite rule ^ (. *) $ /index.php?path=$1 [QSA]  

It basically says that if they ask that the file exists Instead of handing 404 error instead of handing over the index path to a query string variable on the index.php with the path "$ / GET [path '] with" index / path / to / page "set. Finishing the php ends. From there you can drag the contents from a database, a flat file, or what you can do. Mplet can choose.


Comments