Jump to content

How to correctly structure php file


pascal_22

Recommended Posts

Hi everyone.

 

I create a website and now i want to optimize it and well structure it. Actually, all php file are in root directory and i want to well structure it.

 

Is there a better way to structure it? i mean, include file should be with or not with display php page?, And what about processing page that validate form and inserting/update row in database then redirect to another page... they should be in their own folder?

 

Thanks for your help.

 

Pascal

Link to comment
https://forums.phpfreaks.com/topic/281088-how-to-correctly-structure-php-file/
Share on other sites

The general rule is to separate the logic from the markup. As far as file structure goes, there isn't a single, definite way. Commonly, the index would be in the root directory, and the includes, stylesheets, javascript, and any additional files would be divided into separate folders.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.