Jump to content

Recommended Posts

All

 

Still new to php but I ve been playing with using includes and Ithink i ve got my head around it but was looking for views really on the impact of using includes in the way I have. I guess im after what would be considered a best parctice etc.....

 

I ve attached a very basic framework which has an index page where all the content is called from various other files i.e.

 

header.inc.php,

body.inc.php and

footer.inc.php.

 

I have also set up a config page for the content i might want to use over and over, and one for styles if not using css. Finally I have set up a my.inc.php file that i call from the index.php  that containes all the paths to the other files all in one place so I can easily find what i want to update and if i want to experiment with womething new i dont need to update the whole thing, just the bit of code im interested in.

 

Im assuming this is the best way to add themes to my site as well?

 

Anyway if you could have a look and let me know id appreciate it, i ve made sure its well commented

 

Gibbo

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/183866-best-way-of-using-includes/
Share on other sites

Seems good to me. What you need to remember is that "best practice" doesn't always work for everyone. If the system you have currently works best for you, and makes editing your site/adding new things easier, than all the power to you. That's not to say that certain practices aren't terrible, but as long as you stray away from bad practice, then what you are doing is most likely fine.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.