Are PHP includes almost as good as having a CMS?

16 replies
I am just learning to use PHP includes for updating menus, headers and footers in a CSS/HTML layout, but as for updating I almost find the concept as fast as updating a WP or Joomla site, but having much more design control over the look and feel.

Is this a reasonable statement about using PHP includes?
#cms #good #includes #php
  • Profile picture of the author ninal
    I actually use php includes for some of my sites simply because it's simpler for me (plus the fact that my internet connection may be crawling at times). I would see this as more of a personal preference. People with no knowledge of html/css will opt for wordpress since that's simpler for them. I on the other hand can setup a site much faster with php includes.

    But if I foresee a site having a lot of pages, I certainly would just use wordpress. Much easier in the long run and you could have a writer posting for you if needed.
    Signature
    Hello
    {{ DiscussionBoard.errors[2060278].message }}
  • Profile picture of the author TrueStory
    PHP is a language.

    CMS is a system written in language (usually PHP)

    PHP includes is patch-work, while installing full-blown CMS would be whole solution.


    IF having CMS/Wordpress is like speaking a second language, then using bits and pieces of PHP code (sporadically) is like walking around with a dictionary.


    PHP includes are good when you need to include dynamic file and you don't want to update 20 pages to reflect changes (as person above me stated).

    CMS is Content Management System, meaning it's whole website designed for dynamic content.
    Signature

    Your business matters only to people that matter to your business[/U][/B] - Reach them?

    {{ DiscussionBoard.errors[2060780].message }}
  • Profile picture of the author Sleaklight
    A website made with php includes is easy to update sitewide. I like this method a lot when I want design versatility that is easy and fast to do.
    {{ DiscussionBoard.errors[2060810].message }}
    • Profile picture of the author theIMgeek
      PHP includes is patch-work, while installing full-blown CMS would be whole solution.
      I don't think it's appropriate to speak poorly of a PHP solution just because it's simple.

      PHP Code:
      <?php
      pagetitle  'My easy to maintain website';
      include (
      'header.php');
      ?>

      <h1>Welcome to my website</h1>
      <p>I write it using basic PHP and HTML and it works wonderfully!</p>

      <?php
      include ('footer.php');
      ?>
      You could have a great website using code as simple as that. I did just that a several years ago.

      The bonus is that it would load way faster than any Wordpress or CMS site.

      Sometimes a full CMS is "swatting a fly with a sledgehammer".

      -Ryan
      Signature
      FREE WSO: Protect and Automatically Deliver Your Digital Products

      Ask the Internet Marketing Geek
      <-- Happy to help with technical challenges
      MiniSiteMaker.org <-- Free software to make your mini-sites fast and easy
      {{ DiscussionBoard.errors[2061240].message }}
      • Profile picture of the author CarloD.
        Yup, includes are awesome.

        I hand code most of my sites, but if I know I am going to be working on a site with lots and lots of articles, or simply want a blog.... then wordpress or a CMS can handle the job.
        Signature

        {{ DiscussionBoard.errors[2061749].message }}
  • Profile picture of the author Manfred Ekblad
    Your question: Are PHP includes almost as good as having a CMS?
    My answer: What do you want to achieve?

    Can you make money by setting up a website which uses PHP includes to control menu, header and footer? Yes of course. You don't even need PHP includes to do that.

    However, a CMS isn't primarily designed to be a way to let you to change menu, header and footer.
    • Can you dynamically build a XML sitemap using PHP includes?
    • Can you dynamically create a tag cloud of your content using PHP includes?
    • Can you set up a comment system with captcha, automatic anti-spam and trackbacks using PHP includes?
    • Can you allow multiple users to update content on your website from any browser without knowing a thing about FTP, using PHP includes?
    • ...and so on.

    If you build simple websites and you just want to speed up the process of building them, then your way of using PHP includes to update the menu, header and footer... is a great idea!
    {{ DiscussionBoard.errors[2061771].message }}
    • Profile picture of the author theIMgeek
      I like a challenge!

      Originally Posted by Manfred Ekblad View Post

      Can you dynamically build a XML sitemap using PHP includes?
      Yes, your sitemap.PHP could cycle through your folders and files on your website to generate a sitemap. No database required.

      Can you dynamically create a tag cloud of your content using PHP includes?
      This one's a little tougher, and you'd definitely want to cache the results, but yes... as long as you listed your tags in each page, you could still cycle through them all to make a tag cloud. (okay, I'm willing to give this one to CMS)

      Can you set up a comment system with captcha, automatic anti-spam and trackbacks using PHP includes?
      This one is easy! Use a service like Disqus or Intense Debate to add comments with a single line of code in your footer.

      Can you allow multiple users to update content on your website from any browser without knowing a thing about FTP, using PHP includes?
      There are web-based programs that let you edit/manage your site files (as seen in cPanel's File Manager) But if multi-user is of importance, then ya... CMS.

      ..and so on.
      PHP can do it all. Of course, most CMS and Wordpress are built using PHP... so anything they can do PHP can do.. and sometimes do it better if not encumbered by un-used features.

      I love simplicity... even if it's more complex to set-up.

      So, back to the original point... Marty, if you're learning PHP I strongly encourage you to continue using it in it's "raw" form. Coding your own websites from scratch is not only fun, but you can get *just* what you want without unnecessary junk.

      -Ryan
      Signature
      FREE WSO: Protect and Automatically Deliver Your Digital Products

      Ask the Internet Marketing Geek
      <-- Happy to help with technical challenges
      MiniSiteMaker.org <-- Free software to make your mini-sites fast and easy
      {{ DiscussionBoard.errors[2061895].message }}
      • Profile picture of the author CarloD.
        I love simplicity... even if it's more complex to set-up.
        I love this line... mainly because most people answer questions with... just use wordpress... it's a one click install.

        Wordpress and other CMS are great hands down... I still go back to the main questions though.... What is the scope of the project?

        It's kind of like using wordpress sales letter themes.... why have the heavy back end for a simple landing page when a plain old html/css template can do the job. Yes it may require a bit of knowledge to edit the HTML... but it's worth learning.... even if you plan on outsourcing in the future.... it's still nice to have a bit of a clue how things are done on the basic level.

        I have heard many people on this forum with 1000+ posts that seem to be well off in their online marketing adventure... but still throw the comment out "why waste the time when I can outsource it, I have been online for 5 years and don't know how to setup a basic web page... i'll use wordpress"


        ... but to the original question
        Are PHP includes almost as good as having a CMS?

        doesn't really make sense.... wordpress is built on php as are many other CMS. I guess that could make php better than a CMS even though it's comparing 2 things that are not the same.

        Look at the scope of your projects... if you are already updating menus page by page... and you are not planning on a whole site redue... once you get the hang of includes you could easily clean up an existing site and set it up for future editing.

        If the sites are ranking well... to move to wordress you may want to be careful about old URL's... you can loose back links and drop in rankings...but you could always setup redirects using .htaccess ...still could take a while and you would want to make sure you are not missing anything during transition.
        Signature

        {{ DiscussionBoard.errors[2062019].message }}
  • Profile picture of the author Manfred Ekblad
    Well, Mister Peacefull Warrior... it wasn't a challenge for me. In your reply, you're already starting to outline some of the functionality in a CMS :p

    The question still is "Are PHP includes almost as good as having a CMS?". What you are doing is something much more complex than PHP includes "for updating menus, headers and footers".

    But don't worry, relax, I get your point. And I can feel that you are really excited about it!

    As I said, it's a great idea to use PHP includes if the purpose is to produce simple websites and an easy way to update menu, header and footer.

    So again, it boils down to "What do you want to achieve?" as i posted previously.

    PS. I would never let some other service (Disqus or Intense Debate) be the owner of the valuable content on my website. You never know when they cut you off or go out of business.

    PS2. This was just too easy... give me a real challenge!
    {{ DiscussionBoard.errors[2062080].message }}
  • Profile picture of the author ninal
    I do have a question, when it comes to flipping sites, would it be better to have the site in wordpress? I'm assuming that most individuals would be intimated with editing php/html files. And I'm assuming too that they want the ease of changing between themes.

    Basically, this just really boils down to whichever makes your life easier
    Signature
    Hello
    {{ DiscussionBoard.errors[2062124].message }}
    • Profile picture of the author Marty S
      [DELETED]
      {{ DiscussionBoard.errors[2062258].message }}
      • Profile picture of the author jminkler
        Well now that google includes page load speed as a ranking factor ...
        {{ DiscussionBoard.errors[2070624].message }}
  • Profile picture of the author Aperio
    If you're talking includes that are just layout based (i.e. include a nav menu or a header and footer) then you are definitely limited in the scope of what your site will be able to do.. but then, if that's all you really need, that's all you need... Now if your includes are also including function files and classes, then this is a different discussion all together. That's more of a custom cms vs existing cms discussion... so in my opinion it all boils down to what functionality you need currently and for your projected future growth.

    One pitfall to be wary of is of being so focused on the easy solution based on needs now rather than remember to have a scalable solution for the future. Having a roadmap early on can really save you some major hurdles and headaches later on.

    In essence, I'm really just agreeing with those before me that said it's based on the scope of your project and what your individual needs are.
    Signature
    Niche Website Packages- Great deals on complete niche website packages. Use coupon code WFDEALS and get an additional discount.
    {{ DiscussionBoard.errors[2070728].message }}
  • Profile picture of the author Manfred Ekblad
    The header, header.php:

    HTML Code:
    <html>
    <head>
    <title>How to Automatically Generate FLOODS Of Cash, Get The Nobel Prize Award And Save The Earth - No Work Required</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
    <div><a href="home.php">Home</a> | <a href="about-me.php">About me</a></div>
    The content, home.php and about-me.php:
    PHP Code:
    <?php
    require_once("header.php");
    ?>
    <h1>Keep reading and you will be rich in NO time</h1>
    <p>Finally, after 10 years of research the scientists have cracked the code to eternal wisdom, everlasting happiness and the seductive skill of attracting red sports cars using nothing but your own magnetic powers of the Universe.</p>
    <?php
    require_once("footer.php");
    ?>
    The footer, footer.php:
    HTML Code:
    <div>Copyright &copy; 2010 MiracleCashTsunami Ltd.</div>
    </body>
    </html>
    I hope that will get you started

    What is your website project about?
    {{ DiscussionBoard.errors[2071802].message }}
  • Profile picture of the author ryanstreet
    To answer the original question of the OP:

    No. Includes are not as good as a CMS.

    Why?

    Simple. Imagine setting up a 10-50+ page site. No problem to update your menus and such with one file. That should be great.

    But now you want to change or add something that isn't in an included file. Now you have to do the very thing you wanted to avoid, which is open and edit every file in your site. Kinda counter-productive. Then you have to re-upload them to your server.

    Install your CMS once. Edit it right on the site. Enable scalability. All changes do not need to be re-uploaded. Add extra features with one click. Seems like a pretty easy solution.

    Does your site have less than 10 files and it won't ever get bigger? Just make a static site at that point. It almost seems like more work to incorporate includes anyway for a 10 page or less site.

    Just my two cents. And if people want to argue, go ahead. You're not changing my mind. I do this for a living.

    Later.
    Signature
    Ryan Street
    PHP Developer Specializing in WordPress and Magento
    {{ DiscussionBoard.errors[2074233].message }}
    • Profile picture of the author Marty S
      [DELETED]
      {{ DiscussionBoard.errors[2074379].message }}
      • Profile picture of the author ryanstreet
        Originally Posted by Marty S View Post

        Also, what if I had a few templates created with PHP includes that I could sort of use (and adjust) for any new site that I wanted. Surely that would expedite production and help with the speed of updating a few sites strung together???

        Any template is going to expedite production, just be careful of relying too heavily on an include system. (see reasons above).

        Hope this helps.
        Signature
        Ryan Street
        PHP Developer Specializing in WordPress and Magento
        {{ DiscussionBoard.errors[2076466].message }}
  • Profile picture of the author Katie_White
    Yes Its same as using cms according to me but they have many other uses too of using includes
    {{ DiscussionBoard.errors[2080280].message }}

Trending Topics